Re: Consider low startup cost in add_partial_path

2020-04-05 Thread Tomas Vondra
Hi, For the record, here is the relevant part of the Incremental Sort patch series, updating add_partial_path and add_partial_path_precheck to also consider startup cost. The changes in the first two patches are pretty straight-forward, plus there's a proposed optimization in the precheck functi

Re: Consider low startup cost in add_partial_path

2019-10-24 Thread James Coleman
On Fri, Oct 4, 2019 at 8:36 AM Robert Haas wrote: > > On Wed, Oct 2, 2019 at 10:22 AM James Coleman wrote: > > In all cases I've been starting with: > > > > set enable_hashjoin = off; > > set enable_nestloop = off; > > set max_parallel_workers_per_gather = 4; > > set min_parallel_index_scan_size

Re: Consider low startup cost in add_partial_path

2019-10-04 Thread Robert Haas
On Wed, Oct 2, 2019 at 10:22 AM James Coleman wrote: > In all cases I've been starting with: > > set enable_hashjoin = off; > set enable_nestloop = off; > set max_parallel_workers_per_gather = 4; > set min_parallel_index_scan_size = 0; > set min_parallel_table_scan_size = 0; > set parallel_setup_c

Re: Consider low startup cost in add_partial_path

2019-10-02 Thread James Coleman
On Sat, Sep 28, 2019 at 7:21 PM James Coleman wrote: > Now the trick is to figure out a way to demonstrate it in test :) > > Basically we need: > Path A: Can short circuit with LIMIT but has high total cost > Path B: Can’t short circuit with LIMIT but has lower total cost > > (Both must be paralle

Re: Consider low startup cost in add_partial_path

2019-09-28 Thread James Coleman
On Saturday, September 28, 2019, Tomas Vondra wrote: > On Sat, Sep 28, 2019 at 12:16:05AM -0400, Robert Haas wrote: > >> On Fri, Sep 27, 2019 at 2:24 PM James Coleman wrote: >> >>> Over in the incremental sort patch discussion we found [1] a case >>> where a higher cost plan ends up being chosen

Re: Consider low startup cost in add_partial_path

2019-09-28 Thread Tomas Vondra
On Sat, Sep 28, 2019 at 12:16:05AM -0400, Robert Haas wrote: On Fri, Sep 27, 2019 at 2:24 PM James Coleman wrote: Over in the incremental sort patch discussion we found [1] a case where a higher cost plan ends up being chosen because a low startup cost partial path is ignored in favor of a lowe

Re: Consider low startup cost in add_partial_path

2019-09-27 Thread Robert Haas
On Fri, Sep 27, 2019 at 2:24 PM James Coleman wrote: > Over in the incremental sort patch discussion we found [1] a case > where a higher cost plan ends up being chosen because a low startup > cost partial path is ignored in favor of a lower total cost partial > path and a limit is a applied on to

Consider low startup cost in add_partial_path

2019-09-27 Thread James Coleman
Over in the incremental sort patch discussion we found [1] a case where a higher cost plan ends up being chosen because a low startup cost partial path is ignored in favor of a lower total cost partial path and a limit is a applied on top of that which would normal favor the lower startup cost plan