skill
BigQuery query optimization
bigquery-query-optimization
Reads the BigQuery query plan (stages, shuffle, workers) and fixes pruning, join order, skew and function choices.
When to use it
A BigQuery query is slow, expensive or scans too much.
Technical description
Diagnoses and rewrites slow BigQuery SQL using the query plan (stages, shuffle, workers) — partitioning/clustering pruning, JOIN ordering and broadcast vs. shuffle joins, skewed JOINs, WHERE clause selectivity, and approximate/SQL-vs-JS function choices. Use when a BigQuery query is slow, expensive, or hitting Resources Exceeded, or when reviewing a query plan.