Re: REINDEX blocks virtually any queries but some prepared queries.

From: Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: REINDEX blocks virtually any queries but some prepared queries.
Date: 2022-04-07 13:43:57
Message-ID: c85da18d-7a86-6b2c-91cc-edb9ec90ce88@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/7/22 14:40, Justin Pryzby wrote:
> On Thu, Apr 07, 2022 at 01:37:57PM +0200, Frédéric Yhuel wrote:
>> Maybe something along this line? (patch attached)
> Some language fixes.

Thank you Justin! I applied your fixes in the v2 patch (attached).

> I didn't verify the behavior, but +1 to document the practical consequences.
> I guess this is why someone invented REINDEX CONCURRENTLY.
>

Indeed ;) That being said, REINDEX CONCURRENTLY could give you an
invalid index, so sometimes you may be tempted to go for a simpler
REINDEX, especially if you believe that the SELECTs won't be blocked.

Attachment Content-Type Size
0001-Doc-Elaborate-locking-considerations-for-REINDEX_v2.patch text/x-patch 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-04-07 13:45:17 Re: should vacuum's first heap pass be read-only?
Previous Message Blake, Geoff 2022-04-07 13:41:23 Re: Add spin_delay() implementation for Arm in s_lock.h