Bigquery Sql

作者 gemini-cli-extensions2df10e25bbf7无许可证215 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

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.

仅含说明Data & Analytics
AI 生成的概览

提供 BigQuery SQL 优化规则,用于提升查询性能、降低成本并设计高效转换。

功能
提供一套 BigQuery SQL 性能与效率准则,涵盖列裁剪、谓词下推、连接优化和物化策略。它区分自动应用的规则、必须执行的改写,以及需确认后才提出的条件性变更。它还要求输出一个仅列出已应用优化的摘要部分。
适用场景
适用于优化 BigQuery SQL 查询、降低查询成本或设计高性能 SQL 转换的场景。适合依据所列规则审查或改写现有 BigQuery 查询。
运行要求
仅为说明性指令,不附带脚本。假定处理对象是 BigQuery SQL 查询,本身不需要凭据或网络访问。

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.

来源与署名

来源:gemini-cli-extensions/data-agent-kit-starter-pack位于skills/bigquery-sql提交2df10e2

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 gemini-cli-extensions/data-agent-kit-starter-pack 的技能

Schema Mapping

gemini-cli-extensions

为 ETL、ELT 或数据集成任务规划源到目标的模式映射,产出文档化的映射宣言。

Data & Analytics215今天更新

Resolving Mcp Region Configs

gemini-cli-extensions

修复区域级 Google Cloud MCP 服务器配置中未替换的区域占位符,使缺失的 MCP 工具得以注册。

DevOps & Cloud215今天更新

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.

待分类215今天更新

Ml Best Practices

gemini-cli-extensions

为机器学习笔记本提供分步方案,涵盖聚类、预测、分类、回归和模型比较。

Data & Analytics215今天更新

Managing Python Dependencies

gemini-cli-extensions

指导代理检测 Python 项目的依赖管理器并正确安装依赖,而不是使用全局 pip。

Software Development215今天更新

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).

待分类215今天更新