You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the queue is large that will create a lot of IO and WAL with 1 record per deleted tuple. At scale that could contribute to exhausting IO on the primary and cause replication lag on any replicas
What do you think about swapping it out for something like
SELECT count(*) INTO deleted_count FROM pgmq.my_tab;
TRUNCATE pgmq.my_tab;
since truncate produces a single WAL record a little IO on the primary?
The text was updated successfully, but these errors were encountered:
Yea I think this is a good enhancement. We've also seen poor perf when queue grows very large and have used TRUNCATE directly on the queue table as a workaround. I think makes sense to put that in the API.
In
pgmq.purge(queue_name text)
it usesdelete from
with nowhere
clause and then collect the row count withGET DIAGNOSTICS
pgmq/pgmq-extension/sql/pgmq--1.4.0--1.4.1.sql
Lines 310 to 311 in 78a766b
If the queue is large that will create a lot of IO and WAL with 1 record per deleted tuple. At scale that could contribute to exhausting IO on the primary and cause replication lag on any replicas
What do you think about swapping it out for something like
since truncate produces a single WAL record a little IO on the primary?
The text was updated successfully, but these errors were encountered: