Re: ts_rank seems very slow (140 ranked documents / second on my machine)

Поиск
Список
Период
Сортировка
От Nicolas Grilly
Тема Re: ts_rank seems very slow (140 ranked documents / second on my machine)
Дата
Msg-id CAG3yVS4axMv0ELL8RXhmhnCsL422yXOR7W=hqDO7ZokoE3E2Ng@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ts_rank seems very slow (140 ranked documents / second on my machine)  (Nicolas Grilly <nicolas@gardentechno.com>)
Список pgsql-general
Reopening a six months old discussion... Is there any plans to improve ts_rank performance by making it able to use GIN/GIST indices?

From re-reading Oleg answers, I understand FTS indices do not contain enough information for ts_rank. Because of that, ts_rank has to read the ts_vector, which is stored in TOAST table, which triggers a random read for each ranked document.

Cheers,

Nicolas Grilly

On Wed, Jul 13, 2011 at 18:55, Nicolas Grilly <nicolas@gardentechno.com> wrote:
The first query ran in 347 seconds; the second one in 374 seconds.
Conclusion: There is no significant overhead in the ts_rank function
itself. It's slow because ts_rank has to read in random order 40 000
ts_vector stored in TOAST table. The   slow execution time looks like
a direct consequence of storing ts_vector in TOAST table...

>  :( The only solution I see is to store enough information for ranking in index.

Is it the expected behavior? How can I improve that?

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

Предыдущее
От:
Дата:
Сообщение: Converting stored procedures from SQL Anywhere to PostGres.
Следующее
От: Andrew Gould
Дата:
Сообщение: Re: Automated Backup Script Help (Linux)