Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2D1E41337B47 for ; Mon, 28 Feb 2011 11:35:49 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 07966-03 for ; Mon, 28 Feb 2011 15:35:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 7296D1337990 for ; Mon, 28 Feb 2011 11:35:41 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p1SFZbTq007267; Mon, 28 Feb 2011 10:35:37 -0500 (EST) To: Marc Cousin cc: Heikki Linnakangas , pgsql-performance@postgresql.org Subject: Re: inheritance: planning time vs children number vs column number In-reply-to: <201102281409.55827.cousinmarc@gmail.com> References: <201102281038.04945.cousinmarc@gmail.com> <4D6B9BC9.1000404@enterprisedb.com> <201102281409.55827.cousinmarc@gmail.com> Comments: In-reply-to Marc Cousin message dated "Mon, 28 Feb 2011 14:09:55 +0100" Date: Mon, 28 Feb 2011 10:35:37 -0500 Message-ID: <7266.1298907337@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/528 X-Sequence-Number: 42666 Marc Cousin writes: > The Monday 28 February 2011 13:57:45, Heikki Linnakangas wrote : >> Testing here with a table with 1000 columns and 100 partitions, about >> 80% of the planning time is looking up the statistics on attribute >> width, to calculate average tuple width. I don't see O(n^2) behavior, >> though, it seems linear. > It is only based on experimentation, for my part, of course… > If you measure the planning time, modifying either the columns or the > partitions number, the square root of the planning time is almost perfectly > proportional with the parameter you're playing with. Could we see a concrete example demonstrating that? I agree with Heikki that it's not obvious what you are testing that would have such behavior. I can think of places that would have O(N^2) behavior in the length of the targetlist, but it seems unlikely that they'd come to dominate runtime at a mere 1000 columns. regards, tom lane