Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Gunther <raj(at)gusw(dot)net>
Cc: "pgsql-performa(dot)" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.
Date: 2019-02-24 23:33:19
Message-ID: CAMkU=1x4Pxe3vD5NhSisRgOVbF=8MBA9JA2CU-Lgcuit6uQhNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, Feb 23, 2019 at 4:06 PM Gunther <raj(at)gusw(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2019-02-24 23:39:57 Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.
Previous Message Corey Huinker 2019-02-24 22:52:00 Re: Massive parallel queue table causes index deterioration, but REINDEX fails with deadlocks.