What is database partitioning?

Answer

Partitioning divides a large table into smaller physical segments while keeping it logically as one table. Types: Range partitioning — by value ranges (e.g., orders by year: 2022_orders, 2023_orders); List partitioning — by specific values (e.g., by country); Hash partitioning — hash of a key distributes rows evenly; Composite partitioning — combination. Benefits: query performance (partition pruning scans only relevant partitions), faster maintenance (drop a partition instead of deleting millions of rows), and better data lifecycle management. Supported natively in PostgreSQL, MySQL 8+, Oracle, SQL Server.