Re: Full text search with ORDER BY performance issue

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Full text search with ORDER BY performance issue
Дата
Msg-id 4A649E7702000025000289E3@gw.wicourts.gov
обсуждение исходный текст
Ответ на Full text search with ORDER BY performance issue  (Krade <krade@krade.com>)
Ответы Re: Full text search with ORDER BY performance issue
Список pgsql-performance
Krade <krade@krade.com> wrote:
> SELECT * FROM a WHERE comment_tsv @@ plainto_tsquery('love')
> ORDER BY timestamp DESC LIMIT 24 OFFSET 0;

Have you considered keeping rows "narrow" until you've identified your
24 rows?  Something like:

SELECT * FROM a
  WHERE id in
    (
      SELECT id FROM a
        WHERE comment_tsv @@ plainto_tsquery('love')
        ORDER BY timestamp DESC
        LIMIT 24 OFFSET 0
    )
  ORDER BY timestamp DESC
;

-Kevin

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Fastest char datatype
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Calling conventions