Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One solution for performance degradation with soft deletes is to partition the table by some field like `created` monthly. Queries will need to include `created` in the query is the main downside.



I've only heard of this trick being employed on OLAP scenarios. Is this kind of partitioning also advisable for OLTP workloads?


Depends on the workload. In the past, I've worked on several workflow-based systems that performed lots of OLTP operations to drive live workflows forward, but once a workflow was done the operational data became a lot less interesting. So there it made sense to (say) partition the operational data and table by month, and roll off partitions after 3-6 months.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: