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

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, andrewbille@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-10-15T16:24:34Z
Lists: pgsql-bugs
On Wed, Oct 15, 2025 at 12:56:25PM +1300, David Rowley wrote:
> I tried rewriting the query so that pg_attribute is joined to rather
> than subqueries. With 1500 tables I get:
> 
> master:
> 
> ignore_system_indexes = on
> Execution Time: 6853.262 ms
> 
> ignore_system_indexes = off
> Execution Time: 66.781 ms
> 
> Rewritten query:
> 
> ignore_system_indexes = on
> Execution Time: 53.351 ms
> 
> ignore_system_indexes = off
> Execution Time: 56.965 ms

I tried this with 100K tables and saw the following (ignore_system_indexes
= off):

master:
 Planning Time: 1.672 ms
 Execution Time: 4077.008 ms

rewritten:
 Planning Time: 1.641 ms
 Execution Time: 3427.206 ms

I tried this with ignore_system_indexes = on, too, but it was very slow.

-- 
nathan