From 76aff7a9c801dc2f1569f3012686e81cf244b1fd Mon Sep 17 00:00:00 2001 From: Ankitha Damodara Date: Tue, 7 Jan 2025 10:34:02 +0530 Subject: [PATCH] Update the ordering in query for ActiveRecordWithLock adapter 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. --- lib/que/sql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/que/sql.rb b/lib/que/sql.rb index 0de73b6..4d12225 100644 --- a/lib/que/sql.rb +++ b/lib/que/sql.rb @@ -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 },