fix(jdbc-postgres): drop the queues_pk and use an hash index instead (#2277)

This avoids the queues_pkey index to be used by the poll query which is suboptimal.
This commit is contained in:
Loïc Mathieu
2023-10-11 14:23:00 +02:00
committed by GitHub
parent da2fc3c546
commit d95f1003b9

View File

@@ -0,0 +1,5 @@
-- We drop the PK, otherwise its index is used by the poll query which is sub-optimal.
-- We create an hash index on offset that will be used instead when filtering on offset.
ALTER TABLE queues DROP CONSTRAINT IF EXISTS queues_pkey;
CREATE INDEX IF NOT EXISTS queues_offset ON queues USING hash ("offset");