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
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