Re: Concurrency issue with DROP INDEX CONCURRENTLY - Mailing list pgsql-general

From Kiriakos Georgiou
Subject Re: Concurrency issue with DROP INDEX CONCURRENTLY
Date
Msg-id 2FF834BB-A328-4E18-B02E-0AF66F69C2D6@olympiakos.com
Whole thread Raw
In response to Concurrency issue with DROP INDEX CONCURRENTLY  (Kiriakos Georgiou <kg.postgresql@olympiakos.com>)
List pgsql-general
My apologies - there is no issue with DROP INDEX CONCURRENTLY.
It’s just brain fade on my part (I dropped the existing index before creating the new UNIQUE index, causing TPS on this
tableto go to zero *facepalm*). 

Regards,
Kiriakos


> On Feb 9, 2023, at 10:45 AM, Kiriakos Georgiou <kg.postgresql@olympiakos.com> wrote:
>
> Hello,
>
> I have an interesting concurrency issue with DROP INDEX CONCURRENTLY that I can summarize with this test scenario:
>
> /**************************************************/
>
> — suppose we have this table and index
> create table test(x int);
> create index idx1 on test(x);
>
> — now suppose with the database “live” and the above table super busy (lots of queries on the table using index
idx1),I decide to make the index unique 
> create unique index concurrently idx2 on test(x); — runs fine
> drop index concurrently idx1; — took 3 hours to finish, since the table is super busy
>
> /**************************************************/
>
> Taking 3 hours to drop the index is not surprising (lots of queries on the table using idx1).  What surprises me is
thedrop index causes havoc with concurrency on the table, causing queries to pile up. 
> Once the drop index finishes, everything goes back to normal.
>
> I thought by using the CONCURRENTLY option, the drop index is “safe” from concurrency issues for the underlying
table,but in the above scenario it doesn’t appear to be “safe”. 
>
> I am trying to formulate a theory to explain this.  Any ideas?
>
> Regards,
> Kiriakos




pgsql-general by date:

Previous
From: Georg Heiler
Date:
Subject: delta.io foreign data wrapper
Next
From: Laurenz Albe
Date:
Subject: Re: Concurrency issue with DROP INDEX CONCURRENTLY