On Wed, Aug 19, 2009 at 3:00 PM, Josh Berkus<josh@agliodbs.com> wrote:
> Tom, Greg, Robert,
>
> Here's my suggestion:
>
> 1. First, estimate the cost of the node with a very pessimistic (50%?)
> selectivity for the calculation.
There is no such thing as a pessimistic selectivity estimation. Right
now a lot of things use nested loops when they should hash, because we
use 0.5%. If we changed it to 50%, then we'd have the opposite
problem (and maybe some merge joins where we should have hashing).
Unfortunately, there is no substitute for accurate estimates. Of
course if the executor had the ability to switch from a nest loop to a
hash join in mid query it would help a great deal, but that's a much
bigger project, I think.
...Robert