Re: Row number estimation...

From: <marin(at)kset(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Row number estimation...
Date: 2014-10-18 23:22:40
Message-ID: 095e38e744c2ec73e7a5027a5f3468a6@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 18 Oct 2014 11:34:18 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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ć

In response to

Browse pgsql-general by date

  From Date Subject
Next Message marin 2014-10-20 05:51:16 Re: 9.3 view / cross join / flat table solution
Previous Message Wells Oliver 2014-10-18 19:13:00 9.3 view / cross join / flat table solution