Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks. - Mailing list pgsql-performance

From Jeff Janes
Subject Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.
Date
Msg-id CAMkU=1x4Pxe3vD5NhSisRgOVbF=8MBA9JA2CU-Lgcuit6uQhNg@mail.gmail.com
Whole thread Raw
In response to Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.  (Gunther <raj@gusw.net>)
List pgsql-performance
On Sat, Feb 23, 2019 at 4:06 PM Gunther <raj@gusw.net> wrote:

the dequeue operation is essentially this:

BEGIN

SELECT jobId, action
  FROM Queue 
  WHERE pending  FOR UPDATE SKIP LOCKED

There is no LIMIT shown.  Wouldn't the first thread to start up just lock all the rows and everyone else would starve?

Cheers,

Jeff
Attachment

pgsql-performance by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Massive parallel queue table causes index deterioration, butREINDEX fails with deadlocks.
Next
From: Jeff Janes
Date:
Subject: Re: Massive parallel queue table causes index deterioration, butREINDEX fails with deadlocks.