Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWO2U-00034e-HF for pgsql-performance@postgresql.org; Thu, 08 Nov 2012 09:04:42 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWO2O-0001NS-Oz for pgsql-performance@postgresql.org; Thu, 08 Nov 2012 09:04:41 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TWO2M-0005Ke-J4 for pgsql-performance@postgresql.org; Thu, 08 Nov 2012 01:04:34 -0800 Date: Thu, 8 Nov 2012 01:04:34 -0800 (PST) From: Denis To: pgsql-performance@postgresql.org Message-ID: <1352365474583-5731188.post@n5.nabble.com> In-Reply-To: <8407.1352300557@sss.pgh.pa.us> References: <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> <8407.1352300557@sss.pgh.pa.us> Subject: Re: [HACKERS] pg_dump and thousands of schemas MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.9 (/) X-Archive-Number: 201211/104 X-Sequence-Number: 48470 Tom Lane-2 wrote > Denis < > socsam@ > > 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 > > > -- > Sent via pgsql-performance mailing list ( > pgsql-performance@ > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance Still I can't undesrtand why pg_dump has to know about all the tables? For example I have such an easy table CREATE TABLE "CLog" ( "fromUser" integer, "toUser" integer, message character varying(2048) NOT NULL, "dateSend" timestamp without time zone NOT NULL ); no foreign keys, it doesn't use partitioning, it doesn't have any relations to any other table. Why pg_dump has to gother information about ALL the tables in the database just to dump one this table? -- View this message in context: http://postgresql.1045698.n5.nabble.com/pg-dump-and-thousands-of-schemas-tp5709766p5731188.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com.