Our events table had grown to 800 million rows and 410 GB of heap, with roughly 3,000 inserts per second at peak. Vacuum on it took most of a day, deleting expired data meant slow batched DELETE jobs that bloated the table, and every index rebuild was an event. Partitioning by month was the obvious answer. The hard part was getting there without a maintenance window, because the table sits behind an API that customers call around the clock. This post is the procedure we used on PostgreSQL 17: wh...