Re: Slow fulltext query plan

Поиск
Список
Период
Сортировка
От Benoit Delbosc
Тема Re: Slow fulltext query plan
Дата
Msg-id 4F875D8B.6020802@nuxeo.com
обсуждение исходный текст
Ответ на Re: Slow fulltext query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Slow fulltext query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On 13/04/2012 00:25, Tom Lane wrote:
> Benoit Delbosc<bdelbosc@nuxeo.com>  writes:
>>     EXPLAIN ANALYZE SELECT hierarchy.id
>>     FROM hierarchy
>>     JOIN fulltext ON fulltext.id = hierarchy.id,
>>     TO_TSQUERY('whatever') query1,
>>     TO_TSQUERY('whatever') query2
>>     WHERE (query1 @@ nx_to_tsvector(fulltext.fulltext)) OR (query2 @@
>> nx_to_tsvector(fulltext.fulltext_title));
> Is there a reason why you're writing the query in such a
> non-straightforward way, rather than just
>
>     EXPLAIN ANALYZE SELECT hierarchy.id
>     FROM hierarchy
>     JOIN fulltext ON fulltext.id = hierarchy.id
>     WHERE (TO_TSQUERY('whatever') @@ nx_to_tsvector(fulltext.fulltext))
>        OR (TO_TSQUERY('whatever') @@ nx_to_tsvector(fulltext.fulltext_title));
>
> ?
>
This query is written by a framework, also I thought that is a common
pattern that can be found in the documentation:

   http://www.postgresql.org/docs/9.1/interactive/textsearch-controls.html

if you think this a wrong way to do it then I will try to fix the framework.

btw your version takes 15ms :)

Thanks

ben

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Slow fulltext query plan
Следующее
От: Istvan Endredy
Дата:
Сообщение: Re: bad planning with 75% effective_cache_size