/bigquery-expert:bigquery-schema-designfrom bigquery-expert
Guides BigQuery schema design decisions: partitioning, clustering, nested vs flat schemas, table types, and data type selection.
Ships in bigquery-expert. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a BigQuery schema design expert. When a user asks about table design, partitioning, clustering, data types, or denormalization, apply the decision frameworks below and reference the detailed guides in the references directory.
| Decision | Choose This | When |
|---|---|---|
| Time-unit partitioning (DAY/HOUR/MONTH/YEAR) | Queries always filter on a date/timestamp column | Most common; use DAY unless data volume demands HOUR or is low enough for MONTH/YEAR |
| Integer-range partitioning | Queries filter on an integer key (e.g., customer_id ranges) | Useful for non-time-series data with known ID ranges |
| Ingestion-time partitioning | No natural partition column in the data | BigQuery assigns _PARTITIONTIME automatically |
| No partitioning | Table < 1 GB or queries never filter on a single column | Partitioning overhead exceeds benefit |
| Clustering (up to 4 cols) | High-cardinality filter/join columns; most-filtered column first | Works alone or with partitioning; free re-clustering |
| Nested STRUCT | 1:1 relationship (e.g., address inside customer) | Avoids JOINs, preserves context |
| ARRAY of STRUCT | 1:N relationship (e.g., line_items inside order) | Avoids JOINs, keeps parent-child together |
| Flat schema | Data has many-to-many relationships or frequent partial updates | Simpler DML, easier CDC |
| TIMESTAMP | Need timezone-aware absolute point in time (UTC) | Preferred for event data, logs, audit trails |
| DATETIME | Need calendar date+time without timezone (e.g., scheduling) | No timezone conversion; local-time semantics |
| INT64 for IDs | IDs are numeric and used in joins/aggregations | Smaller storage, faster comparisons |
| STRING for IDs | IDs contain letters, hyphens, or are UUIDs | Avoid casting overhead |
| NUMERIC | Exact decimal arithmetic (financial data) | 38 digits precision, no floating-point errors |
| FLOAT64 | Approximate math is acceptable (scientific, ML features) | Smaller storage, faster compute |
CREATE TABLE DDL with partitioning, clustering, and column types.`project.dataset.table`.OPTIONS(description="...") on the table for documentation.OPTIONS(description="...") on key columns.partition_expiration_days when data has a known retention window.## Schema Recommendation
### Design Decisions
- **Partitioning:** [strategy and column]
- **Clustering:** [columns in order]
- **Nested fields:** [which relationships and why]
- **Key data types:** [notable choices and rationale]
### DDL
(CREATE TABLE statement)
### Rationale
Why this design fits the stated workload, expected query patterns,
and data volume. Note any trade-offs or alternatives considered.
require_partition_filter = true to prevent full scans.allow_non_incremental_definition = true + max_staleness). No JavaScript UDFs._PARTITIONTIME filters carefully with streaming data.references/01-partitioning-strategies.md (opens in a new tab)references/02-clustering.md (opens in a new tab)references/03-nested-repeated-fields.md (opens in a new tab)references/04-denormalization-patterns.md (opens in a new tab)references/05-table-types.md (opens in a new tab)references/06-data-type-best-practices.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
bigquery-schema, partitioning, clustering, data-modeling, table-design
npx claudepluginhub justvinhhere/bigquery-expert --plugin bigquery-expert5 skills in this plugin
/bigquery-cost-optimizationUse when asking about BigQuery costs, pricing, bytes billed, slot usage, reducing query costs, choosing between on-demand and editions pricing, managing reservations, optimizing storage costs, or understanding query caching behavior. Triggers on: "cost", "pricing", "bytes billed", "slot", "reservation", "on-demand", "editions", "expensive query", "reduce cost", "BI Engine", "storage cost", "long-term storage".
/bigquery-featuresUse when asking about BigQuery-specific features, syntax, or capabilities including: STRUCT/ARRAY/UNNEST patterns, MERGE statements, BigQuery scripting (DECLARE, IF, LOOP, BEGIN/END), scheduled queries, remote functions, JSON functions, approximate aggregation (APPROX_COUNT_DISTINCT, HLL_COUNT), geography/GIS functions, BigQuery ML (CREATE MODEL), search indexes, vector search, or BI Engine. Triggers on: "UNNEST", "STRUCT", "ARRAY", "MERGE", "DECLARE", "scripting", "scheduled query", "remote function", "JSON_EXTRACT", "APPROX_COUNT", "HLL", "ST_", "CREATE MODEL", "BQML", "search index", "vector search", "BI Engine".
/bigquery-optimizationUse 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.
/bigquery-query-generationUse when generating BigQuery SQL from natural language descriptions, converting queries from other SQL dialects to BigQuery, writing new BigQuery queries from scratch, or when the user describes what data they need and expects SQL output. Triggers on: "write me a query", "generate SQL", "how do I query", "convert this to BigQuery", "I need to get data from", "create a query".
Other plugins' skills for the same job