---
title: "partitions"
description: "Partitions in data systems refer to the logical or physical division of large datasets into smaller, more manageable segments."
canonical: "https://motherduck.com/glossary/partitions/"
related:
  - title: "Glossary | MotherDuck Docs"
    url: "https://motherduck.com/docs/troubleshooting/glossary/"
  - title: "Getting Started with DuckLake: A New Table Format for Your Lakehouse"
    url: "https://motherduck.com/blog/getting-started-ducklake-table-format/"
  - title: "Ingest Partitioned S3 Parquet on a Schedule | MotherDuck Docs"
    url: "https://motherduck.com/docs/cookbook/flight-scheduled-s3-ingest/"
gated_asset:
  title: "DuckLake on MotherDuck"
  url: "https://motherduck.com/product/ducklake/"
---

# partitions

> Partitions in data systems refer to the logical or physical division of large datasets into smaller, more manageable segments.

Partitions in data systems refer to the logical or physical division of large datasets into smaller, more manageable segments. This technique is used to improve query performance and data management efficiency. In databases like [DuckDB](https://duckdb.org/), partitioning can be implemented using the `PARTITION BY` clause in window functions or the `PARTITION` keyword in certain SQL statements. For example:

```sql
SELECT 
  year, 
  sales, 
  AVG(sales) OVER (PARTITION BY year) as avg_yearly_sales
FROM sales_data;
```

<glossary-callout guide="duckdb-book-brief" />

This query calculates the average sales for each year, partitioning the data by year. Partitioning is particularly useful for distributed systems and data lakes, where it can facilitate parallel processing and enable faster data retrieval by allowing queries to skip irrelevant partitions. In cloud data warehouses, partitioning strategies often involve date-based or categorical divisions to optimize storage and query patterns.
