3 ms·
Table partitions allow for automatic sharding of data across multiple tables, while treating them as a single collection via a parent table.
by Zikes 10y ago
Table partitions allow for automatic sharding of data across multiple tables, while treating them as a single collection via a parent table.
- agotterer 10y agoWhat is the benefit over PG schemas?
- qaq 10y agoWhy are you comparing partitioned tables with schemas?
- grzm 10y agoTable partitions are for managing data that would ideally belong in the same table that for management reasons you'd like to split into multiple tables. One application is for managing time series data where you only want to keep the most recent data. For example, you want to save the most recent three months. For implementation reasons, running DELETE FROM big_table WHERE some_timestamp < '2016-09-01' is going to be painful. If you partition big_table by month, you can instead issue 'DROP big_table_201609' when you're done with it. Much cleaner and faster. You could do this in previous versions, through convention and scripts. Having it built into PostgreSQL should make this a lot easier. Schemas are something else entirely.