Skip to content

Partitioning strategies in Snowflake and BigQuery start from different defaults. In BigQuery you declare one partitioning column when you create a table, and a query that filters on that column skips the other partitions. Snowflake divides every table into micro-partitions automatically, so the main design choice is whether to add a clustering key. In both warehouses, query cost control comes from organizing the table around the column your queries filter on most, so that each query reads less data.

The SQL below is documented syntax from Google's, Snowflake's, and dbt's documentation, and none of it was run. For writing filters that prune and for dry runs, see BigQuery SQL best practices for analysts. Related guides are on the BigQuery hub and the Snowflake hub.

How each warehouse divides a table

Both warehouses store a table in pieces and skip the pieces a query cannot need, which is called pruning. They differ in who defines the pieces.

BigQuery: partitions you declare

A BigQuery table is partitioned only if you ask for it. BigQuery then writes each row to the matching partition. There are three kinds:

  • Time-unit column. A DATE, TIMESTAMP, or DATETIME column, with daily (the default), monthly, or yearly partitions. The last two types also allow hourly.
  • Ingestion time. BigQuery assigns rows by the time it ingested them, exposed as the pseudocolumn _PARTITIONTIME.
  • Integer range. An INTEGER column divided by a start, an end, and an interval.
-- BigQuery (GoogleSQL). Documented syntax adapted from Google's examples; not run.

-- Time-unit column, monthly partitions
CREATE TABLE mydataset.orders (order_id INT64, order_date DATE)
PARTITION BY DATE_TRUNC(order_date, MONTH);

-- Ingestion time, daily partitions
CREATE TABLE mydataset.raw_events (event_id INT64)
PARTITION BY _PARTITIONDATE;

-- Integer range: start 0, end 100, interval 10
CREATE TABLE mydataset.customers (customer_id INT64)
PARTITION BY RANGE_BUCKET(customer_id, GENERATE_ARRAY(0, 100, 10));

-- From an existing table, partitioned by day and clustered
CREATE TABLE mydataset.orders_by_day
PARTITION BY order_date
CLUSTER BY customer_id AS
SELECT * FROM mydataset.legacy_orders;

Time partition boundaries are in UTC, and rows with a NULL partitioning value go to a partition named __NULL__. A table can also be clustered: up to four columns sort the data into storage blocks, and a filter on them skips blocks.

Snowflake: micro-partitions created automatically

In Snowflake you do not define partitions. All table data is divided automatically into micro-partitions: contiguous units of storage that each hold 50 MB to 500 MB of uncompressed data, stored column by column, in the order the rows were loaded.

For each micro-partition, Snowflake keeps metadata: the range of values in each column, the number of distinct values, and other properties used for optimization. At query time it compares the filter with those ranges, skips the micro-partitions that cannot match, and reads only the referenced columns in the rest. Ranges can overlap, and Snowflake notes that pruning has an effect only when the storage order is correlated with the filter columns.

A table loaded in date order is therefore already organized by date, which Snowflake calls natural clustering. When the load order does not match the filters, or DML (data manipulation language: inserts, updates, deletes, merges) has degraded it, you can define a clustering key: columns or expressions that Snowflake uses to keep similar rows in the same micro-partitions.

-- Snowflake. Documented syntax adapted from Snowflake's examples; not run.

-- Define a clustering key when the table is created
CREATE OR REPLACE TABLE orders (order_ts TIMESTAMP, customer_id NUMBER)
  CLUSTER BY (TO_DATE(order_ts));

-- Add or change the key on an existing table
ALTER TABLE orders CLUSTER BY (TO_DATE(order_ts), customer_id);

-- Report clustering for any columns
SELECT SYSTEM$CLUSTERING_INFORMATION('orders', '(order_ts, customer_id)');

Snowflake vs BigQuery partitioning, side by side

QuestionBigQuerySnowflake
What you declareOne partitioning column, at table creation only. Up to four clustered columns, which can be changed later. Both are optional.Nothing for micro-partitions. Optionally, a clustering key, which can be added, changed, or dropped at any time.
What is automaticWriting each row to its partition, and reclustering clustered tables in the background.Micro-partitioning of every table in load order, its metadata, and reclustering once a key exists.
How pruning happensA qualifying filter on the partitioning column skips whole partitions. A filter on clustered columns skips storage blocks.The filter is compared with the value ranges stored for each micro-partition.
A filter that does not pruneA comparison with a subquery result, which is not a constant.A predicate with a subquery, even one that returns a constant.
What it costs to maintainGoogle lists automatic reclustering among its free operations. More partitions mean more metadata, and partition counts are capped.Micro-partitions need no maintenance from you. A clustering key does cost: reclustering consumes credits, the unit Snowflake bills in, and can add storage.
How to check that pruning happenedBefore the query runs: the dry-run estimate reflects partition pruning. Clustering shows only in the bytes billed afterward.After the query runs: in its Query Profile, compare Partitions scanned with Partitions total on the TableScan operator.

BigQuery: partition, cluster, or both

Google's guidance is to partition when you want cost estimates before a query runs, or partition-level management such as expiring old partitions. It suggests clustering instead when:

  • queries filter or aggregate on several columns, or on a column with many distinct values;
  • partitions would hold less than about 10 GB each, or there would be too many of them;
  • DML statements modify most partitions every few minutes;
  • you do not need a strict cost estimate in advance.

Google suggests both when you need the estimate, or when partitions would average at least 10 GB.

For granularity, Google suggests hourly partitions for a high volume of data spanning a short range, typically under six months, and monthly or yearly partitions for a small amount of data per day over a wide range, combined with clustering on the partitioning column.

The documented limit is 10,000 partitions per table. Daily partitions reach it in about 27 years, hourly partitions in about 417 days.

Snowflake: judging whether a table needs a clustering key

Snowflake's documentation says clustering keys are not intended for all tables, because clustering the data and keeping it clustered has a cost. The best candidate meets all of these criteria:

  • It has a large number of micro-partitions, which typically means multiple terabytes of data.
  • Its queries are selective, reading a small percentage of rows, or they sort on the key.
  • A high percentage of its queries can benefit from the same key.

If the goal is lower cost, the table should also be queried often and changed seldom. Snowflake strongly recommends testing a representative set of queries first.

It lists two signals: queries that run slower than expected or have degraded over time, and a large clustering depth, the average depth of overlapping micro-partitions for the columns you name. SYSTEM$CLUSTERING_INFORMATION returns it. Smaller is better, but Snowflake calls query performance the best indicator.

Automatic Clustering

Once a key is defined, the Automatic Clustering service reclusters the table in the background as it changes, without one of your warehouses and without blocking DML. Reclustering rewrites micro-partitions, and the replaced ones are kept for Time Travel and Fail-safe, Snowflake's data recovery features, which can increase storage costs.

The documentation now describes two versions. Tables clustered before September 1, 2026 stay on Clustering Classic, billed for the Snowflake-managed compute it uses. Newly clustered tables use Optima Clustering, billed on the volume of uncompressed data ingested, scaled by how much of it needs clustering.

How billing differs

  • BigQuery, on-demand pricing. Queries are billed by the bytes read, and pruned partitions are not counted, so pruning lowers that query's charge directly.
  • BigQuery, capacity pricing. You pay for slots, the compute units that process queries. Google states that these costs follow the slot capacity provisioned over time, not the data one query scans.
  • Snowflake. Queries run on virtual warehouses, its compute clusters, and credits are charged by the number of warehouses, how long they run, and their size. Bytes scanned are not part of that formula, so pruning saves money by shortening the work. Automatic Clustering is charged separately.

For other controls, see BigQuery cost optimization.

Choosing a partitioning or clustering column

These steps are advice. Anything marked with a vendor's name is that vendor's guidance.

  1. List the filters first. Collect the WHERE clauses of the queries that read the table most often. A column they do not filter on cannot help. Snowflake ranks candidates the same way: columns in selective filters first, then join columns.
  2. BigQuery, most queries filter on a date or timestamp. Partition by it if partitions would average at least 10 GB (Google), then cluster by the next most filtered column. A fact table filtered by its date column is the common example.
  3. BigQuery, the filter column has many distinct values, or partitions would be small. Cluster instead, with the most frequently filtered column first (Google).
  4. Snowflake. Add nothing at first. If common queries on a multi-terabyte table prune poorly in Query Profile, test a key on the column they filter by.
  5. Snowflake, check the cardinality (the number of distinct values). Snowflake wants enough values to prune and few enough to group rows together. A Boolean flag has too few. A nanosecond timestamp has too many, so cluster on TO_DATE of it. Keep a key to three or four columns, ordered from lowest to highest cardinality.

The vendors differ on cardinality: Google recommends clustering for columns with many distinct values, and Snowflake warns that higher cardinality makes a key more expensive to maintain.

Setting partitioning and clustering in dbt

dbt, the tool that builds warehouse tables from SQL models, sets these options in each model's configuration. On BigQuery, partition_by is a dictionary with field, data_type, and granularity, plus a range when the type is int64. cluster_by takes one column or a list.

-- dbt on BigQuery. Model configuration built from the dbt documentation's examples; not run.
{{ config(
    materialized = 'table',
    partition_by = {
      "field": "created_at",
      "data_type": "timestamp",
      "granularity": "day"
    },
    cluster_by = ["customer_id", "order_id"]
) }}

On Snowflake there is only cluster_by, for example cluster_by=['session_start']. The dbt documentation says dbt orders the model's results by those fields and adds them to the table as clustering keys, which reduces the work left for Automatic Clustering.

The difference carries into incremental models, which process only new or changed rows. On BigQuery, dbt's insert_overwrite strategy replaces whole partitions. On Snowflake, the strategy of that name overwrites the entire table. See also the dbt hub and a beginner's guide to Snowflake.

Frequently Asked Questions

How can you partition an existing table in BigQuery?

You cannot convert it in place. Google's documentation says partitioning is defined when a table is created, so you create a new table with CREATE TABLE ... PARTITION BY ... AS SELECT. That statement can partition by a time-unit column or an integer range, not by ingestion time.

Can you partition a BigQuery table by multiple columns?

No. Only one column can partition a table. To organize it by more columns, partition by one and cluster by up to four, or cluster without partitioning.

What are the limits on partitioning in BigQuery?

Google documents 10,000 partitions per table, 4,000 partitions modified by one job, and 10,000 possible ranges for an integer-range table. For a table that would exceed them, Google suggests a coarser granularity or clustering.

How does partition expiration work in BigQuery?

The partition_expiration_days option sets how long BigQuery keeps each partition, counted from the partition's boundary in UTC. It works for time-unit and ingestion-time partitioning, not integer ranges. A changed setting applies to existing partitions too, and a table expiration takes precedence.

In what ways can partitioning in Snowflake reduce data warehousing costs?

Micro-partition metadata lets a query skip storage that cannot match its filter, so the warehouse does less work. A clustering key can improve that pruning on a very large table, but maintaining it consumes credits, so Snowflake says to cluster only when queries benefit substantially.

Primary sources and further reading

These pages were read on November 22, 2026. Limits, billing, and product behavior change.