More tests for query plans