pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: andrewbille@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.
Date: Wed, 15 Oct 2025 11:24:34 -0500
Message-ID: <aO_KwnHm2AVn0E4m@nathan> (raw)
In-Reply-To: <CAApHDvoU2O-_zKNL-toHwkDcMXCzzvgRUTnA3baEEhCB4vqMRw@mail.gmail.com>
References: <19086-871ff11017d03dc5@postgresql.org>
	<aO6mUj9H2WpEFylG@nathan>
	<1000041.1760471415@sss.pgh.pa.us>
	<aO7IoIEnQDbtFzrs@nathan>
	<CAApHDvoU2O-_zKNL-toHwkDcMXCzzvgRUTnA3baEEhCB4vqMRw@mail.gmail.com>

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





view thread (20+ messages)  latest in thread

Message-ID: <aO_KwnHm2AVn0E4m@nathan>
Permalink:  ../aO_KwnHm2AVn0E4m@nathan/
Also on:    postgresql.org/message-id/aO_KwnHm2AVn0E4m@nathan

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: nathandbossart@gmail.com, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us, andrewbille@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables.
  In-Reply-To: <aO_KwnHm2AVn0E4m@nathan>

* 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