Revert "Merge branch 'query_improvement'"

This reverts commit 180b7efc7b9ee44f5a219903b708d48526c87de7, reversing
changes made to 4834560e5848e019b2a1872d63610c5dda8c8f0e.