Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tomas Vondra
Hi, On 4/16/21 3:09 PM, Tom Lane wrote: > I wrote: >> ... The code to select the >> right child path would be approximately like get_cheapest_fractional_path, >> except that you need to restrict it to paths with the right sort order. > > Duh, I forgot about get_cheapest_fractional_path_for_pathke

Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tom Lane
I wrote: > ... The code to select the > right child path would be approximately like get_cheapest_fractional_path, > except that you need to restrict it to paths with the right sort order. Duh, I forgot about get_cheapest_fractional_path_for_pathkeys(). regards, tom lane

Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tom Lane
Tomas Vondra writes: > On 2/26/21 4:00 AM, Tom Lane wrote: >> Hmm. While the search should be exhaustive, there are pretty >> aggressive pruning heuristics (mostly in and around add_path()) that >> can cause us to drop paths that don't seem to be enough better than >> other alternatives. I suspec

Re: Disabling options lowers the estimated cost of a query

2021-04-15 Thread Tomas Vondra
On 2/26/21 4:00 AM, Tom Lane wrote: > Arne Roland writes: >> I want to examine the exhaustive search and not the geqo here. I'd >> expect the exhaustive search to give the plan with the lowest cost, >> but apparently it doesn't. I have found a few dozen different >> querys where that isn't the ca

Re: Disabling options lowers the estimated cost of a query

2021-04-15 Thread Arne Roland
-performa...@postgresql.org Subject: Re: Disabling options lowers the estimated cost of a query Arne Roland writes: > I want to examine the exhaustive search and not the geqo here. I'd expect the > exhaustive search to give the plan with the lowest cost, but apparently it > doesn

Re: Disabling options lowers the estimated cost of a query

2021-02-25 Thread Tom Lane
Arne Roland writes: > I want to examine the exhaustive search and not the geqo here. I'd expect the > exhaustive search to give the plan with the lowest cost, but apparently it > doesn't. I have found a few dozen different querys where that isn't the case. > I attached one straight forward exam