Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index
Date
Msg-id YaXg2N5gzoHfQjac@paquier.xyz
Whole thread Raw
In response to [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index  (Andrei Zubkov <zubkov@moonset.ru>)
Responses Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index
List pgsql-hackers
On Mon, Nov 29, 2021 at 05:04:29PM +0300, Andrei Zubkov wrote:
> However it is possible that the TOAST table will have more than one
> index. For example, this happens when REINDEX CONCURRENTLY operation
> lefts an index in invalid state (indisvalid = false) due to some kind
> of a failure. It's often sufficient to interrupt REINDEX CONCURRENTLY
> operation right after start.
>
> Such index will cause the second row to appear in a
> pg_statio_all_tables view which obvious is unexpected behaviour.

Indeed.  I can see that.

> Now we can have several regular indexes and several TOAST-indexes for
> the same table. Statistics for the regular and TOAST indexes is to be
> calculated the same way so I've decided to use a CTE here.

Hmm.  Why should we care about invalid indexes at all, including
pg_statio_all_indexes?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Lots of memory allocated when reassigning Large Objects
Next
From: Andrei Zubkov
Date:
Subject: Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index