pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
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 16:08:43 +0200
Message-ID: <20130610140843.GA5680@awork2.anarazel.de> (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>

On 2013-06-10 13:28:32 +0000, Gunnlaugur Thor Briem wrote:
> Hi,
> 
> 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.
> 
> (The use case is copying a few tables over to a test DB, from a large
> production data warehouse.)
> 
> The three queries taking O(N) time are listed below. AFAICT each of these
> queries could be filtered by table name/OID, at least when the number of
> tables matching the -t parameters is small, allowing pg_dump to complete in
> seconds rather than minutes.

Which of those queries take how long in your case?

E.g. I could imagine that the first two can be sped up a bit without
changing the result. E.g. not calling pg_tablespace_location() for every
relation and such.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
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: <20130610140843.GA5680@awork2.anarazel.de>
Permalink:  ../20130610140843.GA5680@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20130610140843.GA5680@awork2.anarazel.de

 · 

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: andres@2ndquadrant.com, gunnlaugur@gmail.com
  Subject: Re: pg_dump is O(N) in DB table count N even if dumping only one table
  In-Reply-To: <20130610140843.GA5680@awork2.anarazel.de>
  References: <CAPs+M8+oJA+8qQoZ7hmLUzuDTgnOmccqT9SD_=5A-iErnbUP_g@mail.gmail.com> <20130610140843.GA5680@awork2.anarazel.de>

* 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