Re: Query planner doesn't use index scan on tsvector GIN index if LIMIT is specifiedQuery planner doesn't use index scan on tsvector GIN index if LIMIT is specified

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query planner doesn't use index scan on tsvector GIN index if LIMIT is specifiedQuery planner doesn't use index scan on tsvector GIN index if LIMIT is specified
Дата
Msg-id 25378.1326215074@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query planner doesn't use index scan on tsvector GIN index if LIMIT is specifiedQuery planner doesn't use index scan on tsvector GIN index if LIMIT is specified  (darklow <darklow@gmail.com>)
Ответы Re: Query planner doesn't use index scan on tsvector GIN index if LIMIT is specifiedQuery planner doesn't use index scan on tsvector GIN index if LIMIT is specified  (Jesper Krogh <jesper@krogh.cc>)
Список pgsql-performance
darklow <darklow@gmail.com> writes:
> But the performance problems starts when i do the same query specifying
> LIMIT.
> *SELECT id FROM cache WHERE tsv @@ to_tsquery('test:*') limit 20;*
> By some reason index is not used.

It apparently thinks there are enough matches that it might as well just
seqscan the table and expect to find some matches at random, in less
time than using the index would take.

The estimate seems to be off quite a bit, so maybe raising the stats
target for this column would help.

            regards, tom lane

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

Предыдущее
От: Mike Blackwell
Дата:
Сообщение: Partitioning by status?
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Partitioning by status?