by reese_john · 3y ago · 0 comments
UPDATE event_queue
SET acquired_at = now()
WHERE id IN (
SELECT id
FROM event_queue
WHERE acquired_at IS NULL
ORDER BY occurred_at
LIMIT 1000 -- Set this limit according to your usage
)
RETURNING *;Would you need a FOR UPDATE in that subquery?