Postgres FM

Partitioning

7 snips
Apr 7, 2023
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ANECDOTE

Nikolay's Early Partitioning Experience

  • Nikolay shared his experience implementing inheritance-based partitioning before PostgreSQL 10 introduced declarative partitioning.
  • He automated batch moves from non-partitioned to partitioned tables, realizing RDS clones were valuable for testing complex logic.
INSIGHT

Partitioning Benefits Beyond Speed

  • Many people mistakenly believe partitioning is mainly for query speed, but its bigger benefits lie in maintenance and vacuum efficiency.
  • Partitioning enables parallel vacuuming, index rebuilding, and fast deletion by dropping whole partitions, improving overall system health.
ADVICE

Tune Vacuum and Index Maintenance

  • Vacuuming and index rebuilding on very large tables is slow and can cause bloat due to the xmin horizon issue.
  • Use partitioning to enable parallel vacuum and limit index sizes, and tune auto vacuum workers to a higher count on large systems.
Get the Snipd Podcast app to discover more snips from this episode
Get the app