Partitioning tables YSQL

This page documents a preview version. v2.23 Preview
Preview includes features under active development and is for development and testing only.
For production, use the latest stable version (v2024.1).

Data partitioning refers to the process of dividing a large table or dataset into smaller physical partitions based on certain criteria or rules. This technique offers several benefits, including improved performance, easier data management, and better use of storage resources. Each partition is internally a table. This scheme is useful for managing large volumes of data and particularly for dropping older data.

Manage large datasets

You can manage large data volumes by partitioning based on time (say by day, week, month, and so on) to make it easier to drop old data, especially when you want to retain only the recent data.

Table partitioning

To understand how large data can be partitioned for easier management, see Partitioning data by time.

Place data closer to users

When you want to improve latency for local users when your users are spread across a large geography, partition your data according to where big clusters of users are located, and place their data in regions closer to them using tablespaces. Users will end up talking to partitions closer to them.

East and west applications

To understand how to partition and place data closer to users for improved latency, see Latency-optimized geo-partitioning.

Adhere to compliance laws

You can partition your data according to the user's citizenship and place their data in the boundaries of their respective nations to be compliant with data residency laws like GDPR.

User data stored within their country's boundaries

To understand how to partition data to be compliant with data residency laws, see Locality-optimized geo-partitioning.