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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrei Zubkov <zubkov(at)moonset(dot)ru>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index
Date: 2022-03-20 22:33:54
Message-ID: 1742254.1647815634@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
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. But this is probably the better way
to go unless someone has an even better idea.

regards, tom lane

Attachment Content-Type Size
v3-0001-pg_statio_all_tables-several-rows-per-table.patch text/x-diff 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-03-20 22:55:37 Re: logical decoding and replication of sequences
Previous Message Tom Lane 2022-03-20 22:08:34 Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index