pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pg_statio_all_tables view for multiple TOAST indexes.
Date: Thu, 24 Mar 2022 20:33:19 +0000
Message-ID: <E1nXU90-001Ddp-N7@gemulon.postgresql.org> (raw)

Fix pg_statio_all_tables view for multiple TOAST indexes.

A TOAST table can normally have only one index, but there are corner
cases where it has more; for example, transiently during REINDEX
CONCURRENTLY.  In such a case, the pg_statio_all_tables view produced
multiple rows for the owning table, one per TOAST index.  Refactor the
view to avoid that, instead summing the stats across all the indexes,
as we do for regular table indexes.

While this has been wrong for a long time, back-patching seems unwise
due to the difficulty of putting a system view change into back
branches.

Andrei Zubkov, tweaked a bit by me

Discussion: https://postgr.es/m/acefef4189706971fc475f912c1afdab1c48d627.camel@moonset.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce95c543763b6fade641a67fa0c70649d8527243

Modified Files
--------------
src/backend/catalog/system_views.sql | 31 ++++++++++++++++++++-----------
src/include/catalog/catversion.h     |  2 +-
src/test/regress/expected/rules.out  | 21 +++++++++++++--------
3 files changed, 34 insertions(+), 20 deletions(-)



Message-ID: <E1nXU90-001Ddp-N7@gemulon.postgresql.org>
Permalink:  ../E1nXU90-001Ddp-N7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nXU90-001Ddp-N7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix pg_statio_all_tables view for multiple TOAST indexes.
  In-Reply-To: <E1nXU90-001Ddp-N7@gemulon.postgresql.org>
  References: <E1nXU90-001Ddp-N7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox