2 ms·
I have a scenario where we want to keep 12 months of data online. When you go to delete the 13th month of data the traditional way: - Postgres has to scan the
by fusiongyro 10y ago
I have a scenario where we want to keep 12 months of data online. When you go to delete the 13th month of data the traditional way:
- Postgres has to scan the whole table to find the old data
- Postgres marks it as free, but doesn't give it back to the OS
Handling this the naive way winds up being both slow and unproductive. With table partitioning, I just go in and DROP TABLE data_2015_11 and get on with life. It's fast and returns space to the OS.