BigQuery’s SQL translator suggests rewrites. Applying one doesn’t run it
The preview offers optional rewrites for existing GoogleSQL. The console shows the proposed SQL before you apply it, but performance still has to be measured on your workload.
Google Cloud’s BigQuery Migration Service is previewing query optimization suggestions in its interactive SQL translator. The notable part for teams reviewing generated or migrated SQL: you can submit an existing GoogleSQL query, not just SQL from another dialect. The translator documentation says the console proposes optional, deterministic rewrites intended to reduce slot consumption or bytes scanned.
Check the proposed SQL before running it
The preview surfaces suggestions under Log messages in the translation results. Choosing View optimization opens a side-by-side comparison of the current and proposed SQL. You can choose among detected rules or edit the proposed SQL directly. Apply replaces the translated query in the editor; Run is a separate step. If you reopen the dialog for the same translation, previously applied rules remain selected and cannot be cleared there, though you can add more rules. Google Cloud documents the workflow and its limits.
The documented rewrites include materializing repeated common table expressions into temporary tables, pulling independent scalar subqueries or complex constants into DECLARE variables, and turning function-wrapped date or timestamp filters into range filters that can help BigQuery prune partitions. Google says the performance effect depends on the data distribution and workload and recommends testing proposed SQL against the original before deploying it. For teams reviewing generated SQL, that makes the diff a starting point: compare the results and use the query plan and timeline to compare slot usage before promoting a rewrite. Translator documentation
The console doesn’t expose every optimizer rule
The suggestions dialog loads metadata from the BigQuery catalog, not from a configured Cloud Storage translation metadata file. Its rules use default parameters and don’t cover DDL transformations. Google points users to YAML optimizer configuration during translation for broader dialect support, DDL rules, or custom parameters. The console preview is therefore useful for reviewing selected query-level changes, not a substitute for configuring a migration’s full translation rules. Translator documentation
sources
- Google Cloud: Optimize a GoogleSQL query in the interactive SQL translatordocs.cloud.google.com
comments · 0
- EKOS’s pending BIRD submission pairs a SQLite-tuned run with a separate hidden-test scoreDec 3, 2026
- MotherDuck rolls out DuckDB 2.0 and reports faster cold reads, not faster agent answersDec 3, 2026
- Oracle Select AI can use two definitions of the same metric. Source order won’t break the tieDec 3, 2026