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 CAApHDvrcM4G0==52jFoAvmxk6ZRjXKq7nkik=fqq6BH=dSJsYA@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.  (Nathan Bossart <nathandbossart@gmail.com>)
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 05:24, Nathan Bossart <nathandbossart@gmail.com> wrote:
> I tried this with ignore_system_indexes = on, too, but it was very slow.

Seems to be due to pg_get_indexdef / pg_get_constraintdef operating on
a cold cat cache. Getting rid of those the rewritten version runs in
1.8 seconds with 100k tables for me.

That invalidates my timings from yesterday as I must have run the
rewritten query once the catcache was populated. Here are updated
results.

ignore_system_indexes = on 1.5k tables:
master: Execution Time: 26167.741 ms
rewritten: Execution Time: 16661.774 ms

ignore_system_indexes = off 1.5k tables:
master: Execution Time: 105.415 ms
rewritten: Execution Time: 97.030 ms

So not as good.

David



pgsql-bugs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c
Next
From: Tom Lane
Date:
Subject: Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.