query_analyzer: New swiss army knife for query analysis