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
signature.asc
Description: PGP signature