Optimised Queries

@nadeeshaan Please provide us a testing Instructions or steps for your several commits.