Query performance improvements