Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables. - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.
Date
Msg-id CAApHDvrNozFw_K2cbe5oLmxt0VSbU5yweKxvybAvnHt+K_MAaA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.
List pgsql-bugs
On Thu, 16 Oct 2025 at 14:31, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.com> writes:
> > Just to put that to the test, I tried the attached.
>
> I'm confused by all the extraneous changes in this?

It includes the query rewrite too in order to get rid of the
subqueries in the targetlist to pg_attribute. There are 3 of those in
total. When ignore_system_indexes is on, that means a 3x Seq Scans to
pg_attribute per returned row. The rewrite gets rid of that and turns
that into a single join to pg_attribute which allows the planner to
hash or merge join to it.  We could just do the conditional calling of
the pg_get_*def() functions, but performance would still be terrible
for ignore_system_indexes=on due to the Seq Scans, and slightly worse
overall.

David



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.
Next
From: Tom Lane
Date:
Subject: Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.