query patterns