Re: Row number estimation... - Mailing list pgsql-general

From
Subject Re: Row number estimation...
Date
Msg-id 095e38e744c2ec73e7a5027a5f3468a6@localhost
Whole thread Raw
In response to Re: Row number estimation...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sat, 18 Oct 2014 11:34:18 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> If the comparison value is outside the range recorded in the histogram,
> and there's a suitable index available, the planner uses the index to
> find out the actual column min or max rather than believing the
histogram
> completely.  See get_actual_variable_range().

Substituting the first histogram value with 1 (the lowest value in the
column/index) and redoing the calculation give the same numbers as the
EXPLAIN ANALISE does.

But how so that the selectivity is now not capped to 0.0001? Without the
index I couldn't get an estimate lower than 100 rows, but with the index
the estimates go all the way down to 1.


> Possibly this behavior ought to be mentioned in the docs ...
It would help a lot :)

Regards,
Mladen Marinović


pgsql-general by date:

Previous
From: Wells Oliver
Date:
Subject: 9.3 view / cross join / flat table solution
Next
From:
Date:
Subject: Re: 9.3 view / cross join / flat table solution