PostgreSQL table partitioning means splitting one large database table into smaller logical pieces. PostgreSQL table partitioning will be worthwhile only when a table would be very large.

Here are a few benefits of what can be achieved with partitioning:

  • Large tables query performance can be improved dramatically
  • Reducing index size and making it more likely that the heavily-used parts of the indexes fit in memory
  • Rarely used data can be moved to slower and cheaper storage media

This topic is divided into three parts, which are as follows and published in the following order:

Part 1. Howto create PostgreSQL table partitioning

Part 2. PHP script to generate SQL commands for PostgreSQL table partitioning

Part 3. Performance testing between partitioned and non partitioned PostgreSQL tables