> 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/