Adding script to test query performance, fix service to give good results