Query optimizations for list view