Updated query file for redis caching