query and pages