Horizontal partitioning consists in segmenting a table into multiple tables each containing a subset of rows and the same columns as the partitioned table in order to optimize data retrieval. You can use any column, including primary keys, as partitioning criteria.
In this example, the table Annual_Sales contains the following columns:
This table may contain a very large amount of data. You could optimize data retrieval by creating horizontal partitions by year. The result is as follows:
Horizontal partitioning has the following pros and cons:
Pros |
Cons |
---|---|
Improve the query response time |
Requires additional joins and unions to retrieve data from multiple tables |
Accelerate incremental data backup and recovery |
Requires more intelligent queries to determine which table contains the requested data |
Decrease time required to load into indexed tables |
Requires additional metadata to describe the partitioned table |
You can partition tables horizontally using the Horizontal Partitioning Wizard.