Skip to content

Commit

Permalink
fix(jdbc-postgres): drop the queues_pk and use an hash index instead (#…
Browse files Browse the repository at this point in the history
…2277)

This avoids the queues_pkey index to be used by the poll query which is suboptimal.
  • Loading branch information
loicmathieu authored and tchiotludo committed Oct 11, 2023
1 parent e045440 commit fbfadde
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit fbfadde

Please sign in to comment.