Re: index usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index usage
Дата
Msg-id 11751.1042815424@sss.pgh.pa.us
обсуждение исходный текст
Ответ на index usage  (Timur Irmatov <thor@sarkor.com>)
Ответы Re: index usage  (Timur Irmatov <thor@sarkor.com>)
Список pgsql-performance
Timur Irmatov <thor@sarkor.com> writes:
> Limit  (cost=0.00..0.19 rows=1 width=6) (actual time=0.43..0.43 rows=0 loops=1)
>   ->  Index Scan using timeindex on mediumstats  (cost=0.00..2898.96 rows=15185 width=6) (actual time=0.42..0.42
rows=0loops=1) 

The planner has absolutely no clue about the behavior of your function,
and so its estimate of the number of rows matched is way off, leading to
a poor estimate of the cost of an indexscan.  There is not much to be
done about this in the current system (though I've speculated about the
possibility of computing statistics for functional indexes).

Just out of curiosity, why don't you lose all this year/month/day stuff
and use a timestamp column?  Less space, more functionality.

            regards, tom lane

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

Предыдущее
От: "Roman Fail"
Дата:
Сообщение: Implicit casting and JOIN syntax constraints
Следующее
От: Timur Irmatov
Дата:
Сообщение: Re: index usage