pgsql: pg_dump: Fix performance regression in attribute statistics quer

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_dump: Fix performance regression in attribute statistics quer
Date: 2026-09-01 21:28:18
Message-ID: E1x1W1h-000000035YR-3KDG@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_dump: Fix performance regression in attribute statistics query.

After adding pg_stats.tableid, we taught pg_dump to use it in the
attribute statistics query for servers running v19 or later.
Notably, we did not give this new form of the query a "redundant
filter clause" like we did the pre-v19 form. Testing indicates
that produces a significant performance regression, and that adding
a similar filter clause to the v19-or-later form of the query fixes
it.

Oversight in commit 4b5ba0c4ca.

Reviewed-by: Sami Imseih <samimseih(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/apQ9nvLW_zFdarYd%40nathan
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7da24355a2993721bf9bc54224b3bb3e601530ce

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2026-09-02 00:04:46 pgsql: Fix nonstandard SQL command doc id= values introduced in the v19
Previous Message Nathan Bossart 2026-09-01 20:21:03 pgsql: Fix scaling of autovacuum freeze scores.