How to speed up word count with tsearch2?

Поиск
Список
Период
Сортировка
От Yudie Pg
Тема How to speed up word count with tsearch2?
Дата
Msg-id e460d0c050331105242d0416@mail.gmail.com
обсуждение исходный текст
Список pgsql-performance
I've tested several keyword count from 2 millions record book
description table that indexed with tseach2 indexing.
The result is always slow for first query attempt.

This my sample query:
-- test one phrase --
SELECT count(*) from table1
WHEREsearchvector @@ to_tsquery('default' ,'david') limit 100
:: returns 16824 records match.
:: take 49618.341 ms (1st attempt)
:: take 504.229 ms (2nd attempt)

-- test two phrase --
SELECT count(*) from table1
WHERE searchvector @@ to_tsquery('default' ,'martha&stewart') limit 100
:: returns 155 records match.
:: take 686.669 ms (1st attempt)
:: take 40.282 ms (2nd attempt)

I use ordinary aggregate function count(*), Is there other way to count faster?

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

Предыдущее
От: Richard_D_Levine@raytheon.com
Дата:
Сообщение: Re: Reading recommendations
Следующее
От: Madison Kelly
Дата:
Сообщение: Very long time to execute and Update, suggestions?