Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CFFC02E009E for ; Mon, 10 Mar 2008 10:43:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50616-01 for ; Mon, 10 Mar 2008 10:43:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id 52AB82E002D for ; Mon, 10 Mar 2008 10:43:18 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.69) (envelope-from ) id 1JYiHW-0001de-3x; Mon, 10 Mar 2008 13:43:10 +0000 To: "Tom Lane" Cc: "Peter Eisentraut" , , "Martijn van Oosterhout" Subject: Re: Maximum statistics target In-Reply-To: <12262.1205153194@sss.pgh.pa.us> (Tom Lane's message of "Mon\, 10 Mar 2008 08\:46\:34 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.hackers" 19444) References: <200803071925.26532.peter_e@gmx.net> <20080307184157.GA23644@svana.org> <28138.1204926525@sss.pgh.pa.us> <200803101136.06204.peter_e@gmx.net> <12262.1205153194@sss.pgh.pa.us> From: Gregory Stark Organization: EnterpriseDB Date: Mon, 10 Mar 2008 13:43:09 +0000 Message-ID: <87ejaibspe.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/261 X-Sequence-Number: 115062 "Tom Lane" writes: > Peter Eisentraut writes: >> Am Freitag, 7. M=E4rz 2008 schrieb Tom Lane: >>> IIRC, egjoinsel is one of the weak spots, so tests involving planning of >>> joins between two tables with large MCV lists would be a good place to >>> start. > >> I have run tests with joining two and three tables with 10 million rows = each, >> and the planning times seem to be virtually unaffected by the statistics= =20 >> target, for values between 10 and 800000. > > It's not possible to believe that you'd not notice O(N^2) behavior for N > approaching 800000 ;-). Perhaps your join columns were unique keys, and > thus didn't have any most-common-values? We could remove the hard limit on statistics target and impose the limit instead on the actual size of the arrays. Ie, allow people to specify larger sample sizes and discard unreasonably large excess data (possibly warning t= hem when that happens). That would remove the screw case the original poster had where he needed to scan a large portion of the table to see at least one of every value even though there were only 169 distinct values. --=20 Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!