Re: Simplifying Text Search

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Simplifying Text Search
Дата
Msg-id 16768.1195079536@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Simplifying Text Search  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Simplifying Text Search  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Yes, this the same problem we had months ago trying to improve the
> syntax, that there was no easy syntax that covered all common use cases.

The thing that we keep coming up against is that we'd like queries to
be able to depend on default_text_search_config.  Quite aside from
anyone's personal opinions about whether operator or function syntax
is preferable, it would clearly be desirable to be able to say
... WHERE textcolumn @@ 'pattern-constant'

and get a fast full-text search that's governed by the current setting
of default_text_search_config (of course, it can only be fast if there
is an index using that same configuration, but that's a setup detail).

It strikes me that now that we have an invalidatable plan cache,
we could fix this by having the planner rewrite "textcolumn @@ something"
into "to_tsvector(regconfig_constant, textcolumn) @@ something",
so long as it marked the resulting plan as needing to be invalidated
by any change in the value of default_text_search_config.  Once you
have that form, it can be matched against an index, and away you go.

Too late for 8.3, but seems doable enough for 8.4.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Simplifying Text Search
Следующее
От: "Trevor Talbot"
Дата:
Сообщение: Re: Simplifying Text Search