Analyze query