pg_kpart 1.0 Released: Prevents Accidental Full-Partition Scans

PostgreSQL · 18 Jun 2026 · 1 min read

#postgresql

pg_kpart version 1.0 has been released. This PostgreSQL extension blocks queries that perform full-partition scans on partitioned tables.

The extension enforces a simple rule: if a query against a protected partitioned table cannot prune any partitions, it is not allowed to run. Instead, the query author receives a clear error message, forcing them to rewrite the query with a filter on the partition key.

Key changes and benefits:

  • Prevents accidental full-hierarchy scans caused by missing WHERE or JOIN conditions on the partition key.
  • Avoids I/O saturation and performance collapse on tables with hundreds of millions or billions of rows.
  • Converts the best practice of always filtering on the partition key from a fragile convention into an enforced rule.
  • Protects all connections from server-wide disruptions.

For developers and DBAs, this addresses a common and painful issue that can bring down production systems. By making partition pruning mandatory, pg_kpart ensures that queries remain efficient and predictable.

Source: https://www.postgresql.org/about/news/pg_kpart-version-10-3316/

Related

auto-curated · source linked above ← all news