Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by postgresql.org (Postfix) with ESMTP id A0037474E71 for ; Sat, 13 Apr 2002 12:05:10 -0400 (EDT) Received: from 1cust137.tnt3.richmond.in.da.uu.net ([67.241.79.137] helo=nick) by albatross.prod.itd.earthlink.net with smtp (Exim 3.33 #1) id 16wQ1T-0004qz-00; Sat, 13 Apr 2002 09:05:08 -0700 Reply-To: From: "Nick Fankhauser" To: "Tom Lane" Cc: "pgsql-admin" Subject: Re: A *short* planner question Date: Sat, 13 Apr 2002 11:03:59 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <11984.1018657676@sss.pgh.pa.us> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200204/109 X-Sequence-Number: 3997 > Hmm. If the outer side of the nestloop were actually hitting 2696 rows > on average, it wouldn't be "lightning fast". So the planner's failure > to choose this plan is probably due to this overestimate. This may be a reasonable estimate- as you might have gathered, we're matching people to court cases. The typical person (hopefully) only has one case that they're involved with, but an attorney may be in the 1K-10K range and a judge in 10k-100K. Since they all live in the same table, the estimate may not be all that far off. In addition, since we're using a "like", typing in only an initial char would get roughly 1/26 of the rows back- Does the planner look at the number of leading chars provided when coming up with a plan? > still on 7.1.*, right? It'd be interesting to know if 7.2 gets > this right; it has more detailed stats and hopefully would make a better > estimate of the number of matches. 7.2 on our development box is on the middle-priority TODO list. (2-4 weeks.) I'll provide feedback when we get there. As always, thanks for the help! -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/