pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_dump is O(N) in DB table count N even if dumping only one table
Date: Mon, 10 Jun 2013 10:04:25 -0400
Message-ID: <21114.1370873065@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPs+M8+oJA+8qQoZ7hmLUzuDTgnOmccqT9SD_=5A-iErnbUP_g@mail.gmail.com>
References: <CAPs+M8+oJA+8qQoZ7hmLUzuDTgnOmccqT9SD_=5A-iErnbUP_g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Gunnlaugur Thor Briem <gunnlaugur@gmail.com> writes:
> pg_dump takes O(N) time dumping just one table (or a few) explicitly
> specified with a -t parameter. It thus becomes painfully slow on a database
> with very many tables.

This is not a bug.  It needs information about all the tables anyway
to deal with dependencies (possible inheritance and similar situations).

Having said that, it does look like getTables is pulling back a lot of
info that we don't need *yet*, and would never need if we conclude we
don't need to dump the table.  Possibly some of this work could usefully
be postponed to, say, getTableAttrs.  OTOH, if that makes the normal
dump-everything case noticeably slower, it's unlikely such a patch would
get accepted.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <21114.1370873065@sss.pgh.pa.us>
Permalink:  ../21114.1370873065@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21114.1370873065@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gunnlaugur@gmail.com
  Subject: Re: pg_dump is O(N) in DB table count N even if dumping only one table
  In-Reply-To: <21114.1370873065@sss.pgh.pa.us>
  References: <CAPs+M8+oJA+8qQoZ7hmLUzuDTgnOmccqT9SD_=5A-iErnbUP_g@mail.gmail.com> <21114.1370873065@sss.pgh.pa.us>

* 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