Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 9B1D22E003B for ; Thu, 1 May 2008 01:41:21 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30642-05 for ; Thu, 1 May 2008 01:41:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 9A0842E0039 for ; Thu, 1 May 2008 01:41:18 -0300 (ADT) 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 m414f7JD000562; Thu, 1 May 2008 00:41:07 -0400 (EDT) To: Gregory Stark cc: "Jeff Davis" , len@pdx.edu, len@cs.pdx.edu, pgsql-performance@postgresql.org Subject: Re: Understanding histograms In-reply-to: <87skx24zfr.fsf@oxford.xeocode.com> References: <4817FC00.50609@cs.pdx.edu> <14251.1209532791@sss.pgh.pa.us> <18628.1209566591@sss.pgh.pa.us> <1209595622.14025.112.camel@dogma.ljc.laika.com> <26230.1209597464@sss.pgh.pa.us> <87skx24zfr.fsf@oxford.xeocode.com> Comments: In-reply-to Gregory Stark message dated "Wed, 30 Apr 2008 20:53:44 -0400" Date: Thu, 01 May 2008 00:41:07 -0400 Message-ID: <561.1209616867@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/2 X-Sequence-Number: 29970 Gregory Stark writes: > This is something that needs some serious thought though. In the case of > partitioned tables I've seen someone get badly messed up plans because they > had a couple hundred partitions each of which estimated to return 1 row. In > fact of course they all returned 0 rows except the correct partition. (This > was in a join so no constraint exclusion) Yeah, one of the things we need to have a "serious" partitioning solution is to get the planner's estimation code to understand what's happening there. regards, tom lane