# Partition Pruning

> Skipping the table parts a query cannot need. Less is read, so it is faster.

**Field:** Data Engineering  
**Category:** Storage & Warehousing  
**Also known as:** Partition Elimination

## Think of it like

It is like skipping the pages of a book you know you do not need.

## Definition

Partition pruning is when a query engine skips the parts of a table it does not need. It looks at the filter in the query, such as one date. It works out which parts can hold matching rows. Then it reads only those parts and ignores the rest. It only works when the filter is on the column the table is split by.

## Example

A query filters on one day of a table split by day. BigQuery reads 2 GB instead of 700 GB, and the bill drops to match.

## Example code

```sql
SELECT COUNT(*)
FROM events
WHERE date = '2026-11-16';
```

Only the folder for that one day is read.

## Why it matters

This is where splitting a table pays off. If you pay for each scan, the bill shrinks too.

## Common mistake

Wrapping the split column in a function, such as YEAR(date) = 2026. Some engines can no longer prune, and read everything.

## Three principles

- **Read the filter.** The engine checks the WHERE clause.
- **Skip whole parts.** Non-matching parts are never opened.
- **Filter the split column.** Pruning needs that exact column.

## Related terms

- [Data Partitioning](https://learn.benibix.com/term/data/data-partitioning)
- [Clustering Key](https://learn.benibix.com/term/data/clustering-key)
- [Query Plan](https://learn.benibix.com/term/development/query-plan)
- [Google BigQuery](https://learn.benibix.com/term/data/bigquery)

![A table split into seven daily folders. A query that filters on one day reads only that folder, and the other six are greyed out as skipped.](https://learn.benibix.com/diagrams/partition-pruning.svg)

---

Source: https://learn.benibix.com/term/data/partition-pruning
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
