Re: Why won't it index scan?

Поиск
Список
Период
Сортировка
От Ed L.
Тема Re: Why won't it index scan?
Дата
Msg-id 200605171407.24332.pgsql@bluepolka.net
обсуждение исходный текст
Ответ на Re: Why won't it index scan?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why won't it index scan?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wednesday May 17 2006 1:26 pm, Tom Lane wrote:
> "Ed L." <pgsql@bluepolka.net> writes:
> > I'm trying to understand what happened here, and I have a
> > theory.
>
> The problem is the horrid misestimation of the selectivity of
> "nursestation_key = 40":
>
>                ->  Bitmap Index Scan on
> idx_visit_nursestation_key  (cost=0.00..69.35 rows=4956
> width=0) (actual time=0.158..0.158 rows=6 loops=1) Index Cond:
> (nursestation_key = 40)
>
> When you're off by a factor of 800+ on the number of matching
> rows, you're going to arrive at a less than optimal plan.
> Increasing the stats target on visit.nursestation_key would be
> the solution.

Ok, makes sense.

So, does this sound like we just happened to get repeatedly
horribly unrepresentative random samples with stats target at
10?  Are we at the mercy of randomness here?  Or is there a
better preventive procedure we can follow to systematically
identify this kind of situation?

Ed

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: autovacuum "connections" are hidden
Следующее
От: Don Y
Дата:
Сообщение: ALTER SEQUENCE