Optimized query action