Bigquery Sql

by gemini-cli-extensions2df10e25bbf7No licenseListed Oct 8, 2026Updated Oct 8, 2026

Provides BigQuery SQL query optimization techniques, execution best practices, and performance tuning rules for high-efficiency querying. Use when optimizing BigQuery SQL queries, reducing query costs, or designing performant SQL transformations.

Instructions onlyData & Analytics
AI-generated overview

Provides BigQuery SQL optimization rules for query performance, cost reduction, and efficient transformations.

What it does
Supplies a set of BigQuery SQL performance and efficiency guidelines covering column pruning, predicate pushdown, join optimization, and materialization strategies. It defines rules that are applied automatically, rewrites that are mandatory, and conditional changes proposed with confirmation. It also asks for a summary section listing only the optimizations applied.
When to use it
Use when optimizing BigQuery SQL queries, reducing query costs, or designing performant SQL transformations. It fits review or rewriting of existing BigQuery queries against the stated rules.
Requirements
Instructions only; no scripts are shipped. It assumes work on BigQuery SQL queries and does not itself require credentials or network access.

BigQuery SQL Optimization

Performance and efficiency guidelines for BigQuery SQL queries. Includes rules for column pruning, predicate pushdown, join optimization, and materialization strategies.

SQL Optimization Rules

[!TIP] Always include a "Summary of Optimizations" section listing only the optimizations applied.

Always Apply (Automatic)

  • Column Pruning: Remove unnecessary columns from all query stages.
  • Common Subexpression Reuse: Factor out identical expressions to avoid redundant computation.
  • Predicate Pushdown: Apply WHERE filters as early as possible.
  • Early Aggregation: Perform GROUP BY before joins when possible.
  • Intermediate Materialization: Choose VIEW vs TABLE for intermediate nodes based on efficiency.
Intermediate Node Strategy
  • VIEW: Small datasets or simple transformations.
  • TABLE: Large datasets, expensive computations, or nodes reused multiple times.

Always Rewrite (Mandatory)

  • WHERE <col> IN (SELECT ...): Replace With WHERE EXISTS (SELECT 1 FROM ...)
  • WHERE (SELECT COUNT(*) ...) > 0: Replace With WHERE EXISTS (SELECT 1 FROM ...)

Propose with Confirmation (Conditional)

  • UNION → UNION ALL: Faster (skips deduplication), but permits duplicate rows.
  • COUNT(DISTINCT) → APPROX_COUNT_DISTINCT: Faster and lower memory, but approximate.

Source and attribution

Source:gemini-cli-extensions/data-agent-kit-starter-packinskills/bigquery-sqlat commit2df10e2

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

More from gemini-cli-extensions/data-agent-kit-starter-pack

Schema Mapping

gemini-cli-extensions

Plans source-to-target schema mappings for ETL, ELT, or data integration work, producing a documented Mapping Manifesto.

Data & AnalyticsOct 8, 2026

Resolving Mcp Region Configs

gemini-cli-extensions

Fixes unreplaced region placeholders in regional Google Cloud MCP server configs so missing MCP tools register.

DevOps & CloudOct 8, 2026

Notebook Guidance

gemini-cli-extensions

This skill guides the use of Jupyter notebooks for data analysis, exploration, and visualization, particularly with BigQuery. It outlines best practices for notebook execution and validation (supporting both cell-by-cell execution and full notebook generation depending on tool availability), library installation, and structuring notebooks for clarity. It also covers specific rules for data cleaning, plotting, and integrating with BigQuery SQL and machine learning workflows. Relevant when any of the following conditions are true: 1. The user request involves a data analysis, data exploration, data visualization, or data insights task that requires multiple steps, queries, or visualizations to answer. 2. The user explicitly requests a notebook (.ipynb). 3. You are creating, editing, or executing cells in a Jupyter notebook. 4. You need to query BigQuery from within a notebook. DO NOT use the Python BigQuery client library; instead, you MUST use the `%%bqsql` magics explained in this skill.

Awaiting classificationOct 8, 2026

Ml Best Practices

gemini-cli-extensions

Guides machine learning notebooks with step-by-step plans for clustering, forecasting, classification, regression and model comparison.

Data & AnalyticsOct 8, 2026

Managing Python Dependencies

gemini-cli-extensions

Guides agents to detect a Python project's dependency manager and install packages correctly instead of using global pip.

Software DevelopmentOct 8, 2026

Google Cloud Storage Fuse

gemini-cli-extensions

Mounts Cloud Storage buckets as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when you need to interact with gcsfuse — decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size the file, stat, and list caches, tune mount flags or config-file settings, apply workload profiles, keep ML checkpointing safe (rename atomicity, hierarchical namespace, close-time finalization, concurrent writers), or diagnose slow training, low throughput, or GCS bill spikes on existing mounts with gcsfuse metrics. Covers mount semantics, the gcsfuse CLI and config file, the GKE gcsfuse CSI driver (Workload Identity principal:// bindings, profile StorageClasses, sidecar sizing), and Cloud Run volume mounts. Don't use for bucket administration or data management without a mount (google-cloud-storage-basics) or for fully POSIX-compliant shared file systems (Filestore, Managed Lustre).

Awaiting classificationOct 8, 2026