Dividing a large table into smaller physical segments (partitions) based on a column value, improving query performance and maintenance operations.
Divides a large table into smaller pieces (partitions) based on a partition key (range, list, or hash). Improves query performance through partition pruning and enables efficient maintenance like archiving old partitions. Essential for tables with billions of rows.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | 5.1 | Supports RANGE, LIST, HASH, and KEY partitioning. All partitions must live in the same schema. Foreign keys referencing partitioned tables are not supported. |
| PostgreSQL | ✓ Supported | 10 | Declarative partitioning (PARTITION BY RANGE/LIST/HASH) added in PG 10. Earlier versions required trigger-based inheritance partitioning. Each partition is a real child table. |
| SQL Server | ✓ Supported | 2005 | Requires creating a PARTITION FUNCTION and PARTITION SCHEME before the table. Partitioning is an Enterprise Edition feature (Standard Edition has limited support since 2016 SP1). |
| Oracle | ✓ Supported | 8i | One of the most mature partitioning implementations. Supports RANGE, LIST, HASH, COMPOSITE (range-hash, range-list), INTERVAL, and REFERENCE partitioning. Requires the Partitioning option. |
| SQLite | ✗ Not Supported | — | No native table partitioning. The common workaround is to use separate tables per partition and combine them with views or UNION ALL queries. |
Partitioning is a mature feature in Oracle and SQL Server, reasonably capable in MySQL and PostgreSQL, and absent in SQLite. Key differences: Oracle's INTERVAL partitioning auto-creates new partitions as data arrives — the other engines require explicit partition management. SQL Server's two-step PARTITION FUNCTION + SCHEME approach is verbose but separates the partitioning logic from the storage layout. PostgreSQL's declarative partitioning since version 10 is clean but foreign keys referencing the parent partitioned table were only fully supported from PG 12. Partition pruning — the optimizer skipping irrelevant partitions — requires that the partition key appear in the WHERE clause; always verify with EXPLAIN. Common pitfalls: MySQL's restriction on foreign keys on partitioned tables, and the fact that a `SELECT *` on the parent in PostgreSQL returns rows from all partitions transparently.
Supports RANGE, LIST, HASH, and KEY partitioning. All partitions must live in the same schema. Foreign keys referencing partitioned tables are not supported.
Declarative partitioning (PARTITION BY RANGE/LIST/HASH) added in PG 10. Earlier versions required trigger-based inheritance partitioning. Each partition is a real child table.
Requires creating a PARTITION FUNCTION and PARTITION SCHEME before the table. Partitioning is an Enterprise Edition feature (Standard Edition has limited support since 2016 SP1).
One of the most mature partitioning implementations. Supports RANGE, LIST, HASH, COMPOSITE (range-hash, range-list), INTERVAL, and REFERENCE partitioning. Requires the Partitioning option.