X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4137B9FA5C8 for ; Thu, 1 Jun 2006 18:33:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 69142-05 for ; Thu, 1 Jun 2006 18:33:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from is.rice.edu (is.rice.edu [128.42.42.24]) by postgresql.org (Postfix) with ESMTP id 66BCB9FA040 for ; Thu, 1 Jun 2006 18:33:13 -0300 (ADT) Received: from scan2.mail.rice.edu (scan2.mail.rice.edu [128.42.59.161]) by is.rice.edu (Postfix) with ESMTP id 131EA4181D; Thu, 1 Jun 2006 16:33:12 -0500 (CDT) Received: from is.rice.edu ([128.42.42.24]) by scan2.mail.rice.edu (scan2.mail.rice.edu [128.42.59.161]) (amavisd-new, port 10024) with ESMTP id 15050-09; Thu, 1 Jun 2006 16:33:09 -0500 (CDT) Received: by is.rice.edu (Postfix, from userid 18612) id 9FB7C41884; Thu, 1 Jun 2006 16:33:09 -0500 (CDT) Date: Thu, 1 Jun 2006 16:33:09 -0500 From: Kenneth Marshall To: Josh Berkus Cc: Greg Stark , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: More thoughts about planner's cost estimates Message-ID: <20060601213309.GL15172@it.is.rice.edu> References: <14821.1149104747@sss.pgh.pa.us> <200606011132.22066.josh@agliodbs.com> <87u074g03a.fsf@stark.xeocode.com> <200606011350.26364.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200606011350.26364.josh@agliodbs.com> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-2.2.1 at scan2.mail.rice.edu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/44 X-Sequence-Number: 84277 Josh, Greg, and Tom, I do not know how sensitive the plans will be to the correlation, but one thought might be to map the histogram X histogram correlation to a square grid of values. Then you can map them to an integer which would give you 8 x 8 with binary values, a 5 x 5 with 4 values per point, or a 4 x 4 with 8 values per point. If close is good enough, that would be a compact way to store some histogram cross correlation information. Ken On Thu, Jun 01, 2006 at 01:50:26PM -0700, Josh Berkus wrote: > Greg, Tom, > > ... > > 2) It isn't even clear what data you're exactly looking for. Certainly > > "correlation" is just shorthand here and isn't what you're actually > > looking for. > > Actually, I'd think that a correlation number estimate (0 = complete > uncorrelated, 1 = completely correlated) would be sufficient to improve > row count estimation significantly, without incurring the vast overhead of > histogramXhistorgram manipulation. > ...