query optimization
Revert "query optimization"

This reverts commit bc57c45da17f1add1f611b6806a335e66ecc215e.
Revert "Revert "query optimization""

This reverts commit b396c6e744a95d8853c7ba123ce5159ff220a15f.