Another bit of improvement for the system-table query prevention

This work is more important for the testcases than the actual code