Choosing the right query for the job