Re: Creating an index-type for LIKE '%value%'

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Creating an index-type for LIKE '%value%'
Дата
Msg-id 20050207214038.GH20493@svana.org
обсуждение исходный текст
Ответ на Re: Creating an index-type for LIKE '%value%'  ("Larry Rosenman" <ler@lerctr.org>)
Список pgsql-general
On Mon, Feb 07, 2005 at 03:16:51PM -0600, Larry Rosenman wrote:
> Oleg Bartunov wrote:
> > Read
> > http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm
> >
> >      Oleg
> > On Mon, 7 Feb 2005, Martijn van Oosterhout wrote:
> Would you have a suggestion to index the following query:
>
> SELECT domain,message,'1' as truth FROM blacklist
> WHERE somedomain ~* '(?:.+\.|)' || domain || '\$')
>
> The somedomain is actually a constant passed in from Exim (it's the
> sender's righthand Side of an E-Mail address).

I'm not sure, but this might be what ltree was designed for. After all,
they're just stems and you want to match any domain ending in that
stem...

Hope this helps,

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: "Berend Tober"
Дата:
Сообщение: Sorting when "*" is the initial character
Следующее
От: Clodoaldo Pinto
Дата:
Сообщение: Re: Out of memory error