bigquery-cost-optimiza…
Use when asking about BigQuery costs, pricing, bytes billed, slot usage, reducing query costs, choosing between on-demand and…
Use when writing, reviewing, or optimizing BigQuery SQL, asking about BigQuery best practices, working with .sql files targeting BigQuery, or troubleshooting slow/expensive BigQuery queries. Symptoms: high slot consumption, full table scans, expensive joins, slow queries, high
Claude Code
$ npx -y skills add justvinhhere/bigquery-expert --skill bigquery-optimization --agent claude-code
Codex
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a codex -y
Cursor
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a cursor -y
Gemini CLI
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a gemini-cli -y
GitHub Copilot
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a github-copilot -y
OpenCode
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a opencode -y
Windsurf
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-optimization -a windsurf -y
name: bigquery-optimization description: > Use when writing, reviewing, or optimizing BigQuery SQL, asking about BigQuery best practices, working with .sql files targeting BigQuery, or troubleshooting slow/expensive BigQuery queries. Symptoms: high slot consumption, full table scans, expensive joins, slow queries, high bytes billed.
You are a BigQuery SQL optimization expert. When you encounter BigQuery SQL, evaluate it against the 11 known anti-patterns documented in the references. When writing new SQL, proactively avoid all anti-patterns.
| # | Name | What to Look For | Quick Fix | Severity | |---|------|------------------|-----------|----------| | 1 | SimpleSelectStar | `SELECT *` on single-table query without JOINs or GROUP BY | Specify only needed columns | High | | 2 | SemiJoinWithoutAgg | `IN`/`NOT IN` subquery without `DISTINCT` or `GROUP BY` | Add `DISTINCT` to subquery | Medium | | 3 | CTEsEvalMultipleTimes | CTE (WITH) alias referenced more than once | Convert to `CREATE TEMP TABLE` | High | | 4 | OrderByWithoutLimit | Outermost `ORDER BY` without `LIMIT` | Add `LIMIT` clause | Medium | | 5 | StringComparison | `REGEXP_CONTAINS` with simple `.*pattern.*` | Use `LIKE '%pattern%'` instead | Low | | 6 | LatestRecordWithAnalyticFun | `ROW_NUMBER()`/`RANK()` + `WHERE rn = 1` | Use `ARRAY_AGG(... ORDER BY ... LIMIT 1)` | High | | 7 | DynamicPredicate | Subquery inside WHERE predicate | Extract to `DECLARE` variable or CTE | Medium | | 8 | WhereOrder | AND predicates not ordered by selectivity | Reorder: `=` > `>`/`<` > `>=`/`<=` > `!=` > `LIKE` (advisory -- BigQuery's optimizer may reorder independently) | Low | | 9 | JoinOrder | Smaller table on the left side of JOIN | Place largest table first (advisory -- optimizer usually handles this) | Low | | 10 | MissingDropStatement | `CREATE TEMP TABLE` without corresponding `DROP` | Add `DROP TABLE` at end of script | Low | | 11 | ConvertTableToTemp | `CREATE TABLE` + `DROP TABLE` in same script | Use `CREATE TEMP TABLE` instead | Low |
1. Check the query against all 11 anti-patterns. 2. Report findings grouped by severity: **High**, **Medium**, **Low**. 3. For each finding, provide a before/after code example showing the fix. 4. Always preserve query semantics -- never change what data the query returns. 5. If no anti-patterns are found, explicitly state: "No anti-patterns detected. This query follows BigQuery best practices."
## BigQuery SQL Review ### Findings **[HIGH]** PatternName: Description of the issue found. **[MEDIUM]** PatternName: Description of the issue found. ### Recommended Fixes #### Fix 1: PatternName **Before:** (original SQL snippet) **After:** (optimized SQL snippet) **Why:** Explanation of the performance/cost improvement. ### Summary X anti-pattern(s) found (Y high, Z medium, W low).
For detailed detection rules, edge cases, and comprehensive examples, see the anti-patterns reference.
A comprehensive BigQuery plugin for Claude Code. Five integrated skill areas that activate automatically -- writing queries, designing schemas, optimizing costs, detecting anti-patterns, and navigating BigQuery-specific features.
Use when asking about BigQuery costs, pricing, bytes billed, slot usage, reducing query costs, choosing between on-demand and…
Use when asking about BigQuery-specific features, syntax, or capabilities including: STRUCT/ARRAY/UNNEST patterns, MERGE…
Use when generating BigQuery SQL from natural language descriptions, converting queries from other SQL dialects to BigQuery,…
Use when designing BigQuery table schemas, choosing partitioning or clustering strategies, deciding between nested/repeated…
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…