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