What problem does it solve? Writing BigQuery SQL that is slow or expensive is a common pain point for data teams. This Skill applies proven optimization rules to reduce query costs, improve execution speed, and enforce performance best practices automatically. ## Core Features & Use Cases - Automatic Optimizations: Applies column pruning, common subexpression reuse, predicate pushdown, and early aggregation to every query. - Mandatory Rewrites: Converts inefficient patterns like WHERE col IN (SELECT ...) and WHERE (SELECT COUNT(*)) > 0 into efficient EXISTS clauses. - Conditional Improvements: Proposes UNION ALL and APPROX_COUNT_DISTINCT rewrites with confirmation when approximate results are acceptable. - Use Case: A data engineer has a slow dashboard query scanning terabytes. Use this Skill to rewrite the query with predicate pushdown and early aggregation, cutting scan volume and slot time. ## Quick Start Optimize this BigQuery SQL query for performance and cost, and summarize the optimizations applied.