Usage → Query

Analyze BigQuery query patterns, compare query performance, and identify optimization opportunities at the query level.

The Query tab provides detailed analysis of query patterns in your BigQuery environment. Queries are grouped by their parameterized hash, which allows you to analyze query patterns regardless of specific parameter values.


Overview

The Query usage view enables you to:

  • Identify the most expensive query patterns
  • Compare similar queries to understand performance variations
  • Track query frequency and resource consumption
  • Drill down into individual query executions

What is a Parameterized Query Hash?

A parameterized query hash groups queries that have the same structure but different literal values. For example, these two queries would have the same hash:

SELECT * FROM orders WHERE customer_id = 123
SELECT * FROM orders WHERE customer_id = 456

This grouping helps you understand how often a query pattern runs and its total cost across all executions.


Page Controls

Project Filter

Filter metrics to specific BigQuery projects.

Project & Region Selection

Select a specific project and region to view queries.

Cost Toggle

Toggle between resource metrics (slots) and cost estimates (USD).


Query Table

The main table displays query patterns with:

ColumnDescription
Query Parameterized HashUnique identifier for the query pattern
Query TypeType of query (SELECT, INSERT, etc.)
Job TypeBigQuery job type
Query TextPreview of the SQL query
Total Slot (ms) / CostAggregate slot consumption or cost
Total Bytes ProcessedTotal data scanned
Last 7d Query CountExecution frequency
LabelsBigQuery job labels

Click on any query hash to view detailed execution history.


Query Comparison

Compare two query patterns side-by-side:

  1. Click the Compare button
  2. Select up to 2 queries
  3. View the SQL differences

This is useful for comparing before/after optimization or understanding why similar queries have different performance.


Query Details Page

Click on a query hash to see:

  • Individual query executions with job IDs, users, duration, and status
  • Execution time trends
  • Resource consumption patterns
  • Detailed query execution stages

Use Cases

Finding Expensive Queries

  • Sort by total cost to find the most expensive query patterns
  • Review the query text to identify optimization opportunities
  • Check frequency to prioritize high-impact improvements

Identifying Optimization Candidates

Look for queries with:

  • High bytes processed (may benefit from partitioning)
  • High slot consumption (may need query optimization)
  • High frequency (small improvements have large aggregate impact)

Debugging Performance Issues

  • Find the query pattern
  • View the execution history
  • Compare recent runs to identify when performance changed
  • NEW! Ask RADEN to help identify the reason for the slowness. RADEN offers query explanation and optimization using the context