Agent skill · google
bigquery-optimization
Provides workflows to optimize BigQuery environments (capacity planning, editions), storage assets (partitioning, clustering, storage lifecycles, billing models), and SQL queries. Use when optimizing cost, modeling Edition migrations, rightsizing reservations, evaluating logical vs. physical storage, designing table partitioning/clustering, generating table DDL, migrating unpartitioned tables, managing partition expiration, optimizing individual SQL queries, or evaluating acceleration structures (search indexes, materialized views, BI Engine). Do not use for raw usage reporting (use bigquery-observability), query execution plan analysis, error troubleshooting, or diagnosing why a specific job was slow (use bigquery-troubleshooting).
What it needs
About 4k tokens when loaded.
What this skill does
BigQuery Optimization Workflow Attribution MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDKMETRICSREQUESTATTRIBUTION="agent-skills/1.0 (skill:bigquery-optimization)" and append agent-skills/1.0 (skill:bigquery-optimization) to User-Agent headers. Prerequisites & Environment Setup Before executing optimization analyses, evaluating editions, or applying DDL modifications: 1. Google Cloud SDK: Ensure the Google Cloud SDK is installed and configured. 2. Project Selection: Set the active Google Cloud project: 3. API Enablement: Ensure BigQuery and BigQuery Reservation APIs are enabled: 4. Authentication: Authenticate the environment: CLI tools and bq commands: gcloud auth login SDKs and automation: gcloud auth application-default login Service accounts: Set GOOGLEAPPLICATIONCREDENTIALS="/path/to/key.json" 5. Billing & IAM Roles: Verify an active Google Cloud Billing account is attached to {projectid}. Ensure appropriate IAM roles: roles/bigquery.admin or roles/bigquery.resourceAdmin: Reservation and capacity commitment management. roles/bigquery.dataEditor or roles/bigquery.admin: Modifying table schemas, partitioning, clustering, and storage billing models. roles/bigquery.jobUser: Running evaluation queries. 6. Companion Skills Installation: This skill is part of a 3-pillar operations suite (bigquery-observability, bigquery-optimization, bigquery-troubleshooting). If any companion skill is not yet installed in your environment, install the full suite: (If bigquery-observability is not installed, use the self-contained baseline formulas and query templates provided directly in the reference sections below). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills google/bigquery-optimization