Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Um2i8-00008x-Bn for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Jun 2013 14:04:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Um2i7-0000XD-5M for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Jun 2013 14:04:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Um2hy-0000Pr-IO for pgsql-bugs@postgresql.org; Mon, 10 Jun 2013 14:04:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Um2hw-0005Rk-5j for pgsql-bugs@postgresql.org; Mon, 10 Jun 2013 14:04:29 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r5AE4QYI021117; Mon, 10 Jun 2013 10:04:26 -0400 (EDT) From: Tom Lane To: Gunnlaugur Thor Briem cc: pgsql-bugs@postgresql.org Subject: Re: pg_dump is O(N) in DB table count N even if dumping only one table In-reply-to: References: Comments: In-reply-to Gunnlaugur Thor Briem message dated "Mon, 10 Jun 2013 13:28:32 -0000" Date: Mon, 10 Jun 2013 10:04:25 -0400 Message-ID: <21114.1370873065@sss.pgh.pa.us> X-Pg-Spam-Score: 0.7 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Gunnlaugur Thor Briem 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