do the right query