Re: Idea about estimating selectivity for single-column expressions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Idea about estimating selectivity for single-column expressions
Date
Msg-id 603c8f070908191204t3cbe136ge0ec0530707a1337@mail.gmail.com
Whole thread Raw
In response to Re: Idea about estimating selectivity for single-column expressions  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: We should Axe /contrib/start-scripts
Next
From: Tom Lane
Date:
Subject: Re: We should Axe /contrib/start-scripts