Postgres engineers detail how to make DELETE perform at scale
A technical blog post explains optimizations for using Postgres DELETE efficiently rather than resorting to table truncation or partition dropping. The authors applied tuning techniques—focused on cache and index performance—to a Postgres-backed durable workflows and queues system handling tens of thousands of workflows and steps per second, in order to enforce data retention policies.