How could I solve the problem of in-order processing based on a key using skip locked? Basically all records having the key to be processed one after other.
SELECT
*
FROM jobs
WHERE partition_key = (
SELECT partition_key
FROM jobs
ORDER BY partition_key
LIMIT 1
SKIP LOCKED
)
ORDER BY submitted_at
FOR UPDATE SKIP LOCKED;Also if events for a partition gets processed quick would the last partition get an equal chance?