Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2022-03-25 Thread Tom Lane
Andrei Zubkov writes: > Thank you for your attention and for the problem resolution. However > I'm worry a little about possible performance issues related to > monitoring solutions performing regular sampling of statistic views to > find out the most intensive objects in a database. There's no a

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2022-03-25 Thread Andrei Zubkov
Hi Tom! On Thu, 2022-03-24 at 16:34 -0400, Tom Lane wrote: > I wrote: > > After a bit of further fooling, I found that we could make that > > work with LEFT JOIN LATERAL.  This formulation has a different > > problem, which is that if you do want most or all of the output, > > computing each sub-ag

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2022-03-24 Thread Tom Lane
I wrote: > After a bit of further fooling, I found that we could make that > work with LEFT JOIN LATERAL. This formulation has a different > problem, which is that if you do want most or all of the output, > computing each sub-aggregation separately is probably less > efficient than it could be.

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2022-03-20 Thread Tom Lane
I wrote: > ... We need to sum separately over the > table indexes and toast indexes, and I don't immediately see how > to do that without creating an optimization fence. After a bit of further fooling, I found that we could make that work with LEFT JOIN LATERAL. This formulation has a different p

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2022-03-20 Thread Tom Lane
Andrei Zubkov writes: > On Tue, 2021-11-30 at 17:29 +0900, Michael Paquier wrote: >> Hmm.  Why should we care about invalid indexes at all, including >> pg_statio_all_indexes? > I think we should care about them at least because they are exists and > can consume resources. For example, invalid in

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2021-12-16 Thread Andrei Zubkov
It seems we need to bump catalog version here. -- Andrei Zubkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2021-11-30 Thread Andrei Zubkov
Hi, Michael Thank you for your attention! On Tue, 2021-11-30 at 17:29 +0900, Michael Paquier wrote: > Hmm.  Why should we care about invalid indexes at all, including > pg_statio_all_indexes? > I think we should care about them at least because they are exists and can consume resources. For exa

Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index

2021-11-30 Thread Michael Paquier
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 of