2 ms·
To make it scale well, two things are required: 1. TRUNCATE if cleanup is needed (no DELETEs) + partitioning. 2. SELECT .. FOR UPDATE SKIP LOCKED or advisory
by samokhvalov 6y ago
To make it scale well, two things are required:
1. TRUNCATE if cleanup is needed (no DELETEs) + partitioning.
2. SELECT .. FOR UPDATE SKIP LOCKED or advisory locks.
It's worth learning from Skype's PgQ developed in 2000-s.
Update: found the work with advisory locks in the code, great.