Re: Is it possible to specify minimum number of rows planner should consider?

2020-09-28 Thread Matthew Bellew
Here is a commit that accomplishes this with a configuration parameter. https://github.com/labkey-matthewb/postgres/commit/b1fd99f4deffbbf3db2172ccaba51a34f18d1b1a On Mon, Sep 28, 2020 at 2:07 PM Tom Lane wrote: > Timothy Garnett writes: > > Is there some way to tell the planner that unless it

Re: Bad plan

2018-01-23 Thread Matthew Bellew
In my opinion this is the Achilles heel of the postgres optimizer. Row estimates should never return 1, unless the estimate is provably <=1. This is particularly a problem with join estimates. A dumb fix for this is to change clamp_join_row_est() to never return a value <2. This fixes most of m