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

2022-04-11 Thread Frédéric Yhuel
On 4/11/22 02:57, Michael Paquier wrote: On Fri, Apr 08, 2022 at 04:23:48PM +0200, Frédéric Yhuel wrote: Thank you Michael. And done as of 8ac700a. -- Thank you Micheal! For reference purposes, we can see in the code of get_relation_info(), in plancat.c, that indeed every index of the t

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

2022-04-10 Thread Michael Paquier
On Fri, Apr 08, 2022 at 04:23:48PM +0200, Frédéric Yhuel wrote: > Thank you Michael. And done as of 8ac700a. -- Michael signature.asc Description: PGP signature

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

2022-04-08 Thread Frédéric Yhuel
On 4/8/22 02:22, Michael Paquier wrote: On Thu, Apr 07, 2022 at 05:29:36PM +0200, Guillaume Lelarge a écrit : Le jeu. 7 avr. 2022 à 15:44, Frédéric Yhuel a écrit : On 4/7/22 14:40, Justin Pryzby wrote: Thank you Justin! I applied your fixes in the v2 patch (attached). v2 patch sounds goo

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

2022-04-07 Thread Michael Paquier
On Thu, Apr 07, 2022 at 05:29:36PM +0200, Guillaume Lelarge a écrit : > Le jeu. 7 avr. 2022 à 15:44, Frédéric Yhuel a > écrit : >> On 4/7/22 14:40, Justin Pryzby wrote: >> Thank you Justin! I applied your fixes in the v2 patch (attached). > > v2 patch sounds good. The location of the new sentenc

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

2022-04-07 Thread Guillaume Lelarge
Le jeu. 7 avr. 2022 à 15:44, Frédéric Yhuel a écrit : > > > 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 v

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

2022-04-07 Thread Frédéric Yhuel
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

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

2022-04-07 Thread Justin Pryzby
reads that attempt to use that index. In contrast, > + which will block reads that attempt to use that index. In particular, > + the PostgreSQL query planner wants to take an ACCESS > SHARE s/wants/tries/ > + lock on every indexes of the table, regardless of the query, and s

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

2022-04-07 Thread Frédéric Yhuel
ssed, - which will block reads that attempt to use that index. In contrast, + which will block reads that attempt to use that index. In particular, + the PostgreSQL query planner wants to take an ACCESS SHARE + lock on every indexes of the table, regardless of the query, and so + REINDEX

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

2022-04-06 Thread Peter Geoghegan
On Wed, Apr 6, 2022 at 7:49 AM Frédéric Yhuel wrote: > From the documentation > (https://www.postgresql.org/docs/current/sql-reindex.html#id-1.9.3.162.7), > it sounds like REINDEX won't block read queries that don't need the > index. But it seems like the planner wants to take an ACCESS SHARE loc

REINDEX blocks virtually any queries but some prepared queries.

2022-04-06 Thread Frédéric Yhuel
Hello, From the documentation (https://www.postgresql.org/docs/current/sql-reindex.html#id-1.9.3.162.7), it sounds like REINDEX won't block read queries that don't need the index. But it seems like the planner wants to take an ACCESS SHARE lock on every indexes, regardless of the query, and s