Figuring out where queries come from