diff --git a/jdbc-postgres/src/main/resources/migrations/postgres/V1_3__postgres-queues-pkey.sql b/jdbc-postgres/src/main/resources/migrations/postgres/V1_3__postgres-queues-pkey.sql new file mode 100644 index 00000000000..04f52c25870 --- /dev/null +++ b/jdbc-postgres/src/main/resources/migrations/postgres/V1_3__postgres-queues-pkey.sql @@ -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"); \ No newline at end of file