Re: Full text search - query plan? PG 8.4.1

Поиск
Список
Период
Сортировка
От Jesper Krogh
Тема Re: Full text search - query plan? PG 8.4.1
Дата
Msg-id 4AE5D7CC.202@krogh.cc
обсуждение исходный текст
Ответ на Re: Full text search - query plan? PG 8.4.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Full text search - query plan? PG 8.4.1
Список pgsql-performance
Tom Lane wrote:
> Jesper Krogh <jesper@krogh.cc> writes:
>> Is is possible to manually set the cost for the @@ operator?
>
> You want to set the cost for the underlying function.

alter function ts_match_vq(tsvector,tsquery) cost 500

seems to change my test-queries in a very positive way (e.g. resolve to
bitmap index scan on most queryies but fall onto index-scans on
alternative columns when queriterms are common enough).

According to the documentation the default cost is 1 for builin
functions and 100 for others, is this true for the ts-stuff also?
Can I query the database for the cost of the functions?

It somehow seems natural that comparing a 1,3 term tsquery to a 200+
term tsvector is orders of magitude more expensive than simple operations.

I somehow suspect that this is a bad thing to do if I have other
gin-indexes where the tsvector is much smaller in the same database. But
then I can just use ts_match_qv for those queries or add my own which
justy raises the cost.

Thanks.

--
Jesper

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

Предыдущее
От: Michal J. Kubski
Дата:
Сообщение: Re: query planning different in plpgsql?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Full text search - query plan? PG 8.4.1