Query optimized
Signed-off-by: Jatin Chauhan <jatin.chauhan@shephertz.co.in>