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 4E7A59FA5C8 for ; Thu, 1 Jun 2006 18:51:04 -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 69384-09 for ; Thu, 1 Jun 2006 18:50:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by postgresql.org (Postfix) with ESMTP id 5E5EB9FA040 for ; Thu, 1 Jun 2006 18:50:59 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO [192.168.1.27]) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 9509571; Thu, 01 Jun 2006 14:49:19 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-hackers@postgresql.org Subject: Re: More thoughts about planner's cost estimates Date: Thu, 1 Jun 2006 14:45:40 -0700 User-Agent: KMail/1.8 Cc: Greg Stark , Tom Lane References: <14821.1149104747@sss.pgh.pa.us> <87u074g03a.fsf@stark.xeocode.com> <200606011350.26364.josh@agliodbs.com> In-Reply-To: <200606011350.26364.josh@agliodbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200606011445.41158.josh@agliodbs.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/24 X-Sequence-Number: 84257 Greg, > > 1) You have n^2 possible two-column combinations. That's a lot of > > processing and storage. > > Yes, that's the hard problem to solve. =A0Actually, btw, it's n!, not n^2. Ooops, bad math. Andrew pointed out it's actually n*(n-1)/2, not n!. Also, we could omit columns unlikely to correlate, such as large text=20 columns, bytea and numerics with high precisions. Also, we probably don't= =20 need to correlate UNIQUE columns inside ... I think. =2D-=20 =2D-Josh Josh Berkus PostgreSQL @ Sun San Francisco