Skip to content

Commit

Permalink
Update the ordering in query for ActiveRecordWithLock adapter
Browse files Browse the repository at this point in the history
why?
This is to test the performance of the query for databse that uses
lsm and SST for storage. When the load is huge there is pperformance
degredation because of the dead tuples building up. we want move job_id
before run_at.
  • Loading branch information
ankithads committed Jan 7, 2025
1 parent 5263262 commit 76aff7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/que/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ module Que
AND run_at <= now()
AND retryable = true
AND job_id >= $2
ORDER BY priority, run_at, job_id
ORDER BY priority, job_id, run_at
FOR UPDATE SKIP LOCKED
LIMIT 1
},
Expand Down

0 comments on commit 76aff7a

Please sign in to comment.