Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TW79L-0001W9-KF for pgsql-performance@postgresql.org; Wed, 07 Nov 2012 15:02:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TW79K-0001Ru-HZ for pgsql-performance@postgresql.org; Wed, 07 Nov 2012 15:02:38 +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 qA7F2bkk008408; Wed, 7 Nov 2012 10:02:37 -0500 (EST) From: Tom Lane To: Denis cc: pgsql-performance@postgresql.org Subject: Re: [HACKERS] pg_dump and thousands of schemas In-reply-to: <1352284972611-5730998.post@n5.nabble.com> References: <20120830204433.GW8753@momjian.us> <1086.1346359916@sss.pgh.pa.us> <27683.1346383075@sss.pgh.pa.us> <1352211374706-5730864.post@n5.nabble.com> <13005.1352214454@sss.pgh.pa.us> <1352216421913-5730877.post@n5.nabble.com> <16061.1352224264@sss.pgh.pa.us> <1352284972611-5730998.post@n5.nabble.com> Comments: In-reply-to Denis message dated "Wed, 07 Nov 2012 02:42:52 -0800" Date: Wed, 07 Nov 2012 10:02:37 -0500 Message-ID: <8407.1352300557@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/86 X-Sequence-Number: 48452 Denis writes: > Tom Lane-2 wrote >> Hmmm ... so the problem here isn't that you've got 2600 schemas, it's >> that you've got 183924 tables. That's going to take some time no matter >> what. > I wonder why pg_dump has to have deal with all these 183924 tables, if I > specified to dump only one scheme: "pg_dump -n schema_name" or even like > this to dump just one table "pg_dump -t 'schema_name.comments' " ? It has to know about all the tables even if it's not going to dump them all, for purposes such as dependency analysis. > We have a web application where we create a schema with a number of tables > in it for each customer. This architecture was chosen to ease the process of > backup/restoring data. I find that argument fairly dubious, but in any case you should not imagine that hundreds of thousands of tables are going to be cost-free. regards, tom lane