GetQueryKey optimizations