debug order of query