Re: [HACKERS] Index greater than 8k

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Darcy Buskermolen <darcyb(at)commandprompt(dot)com>, PgSQL General <pgsql-general(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Index greater than 8k
Date: 2006-11-01 13:26:36
Message-ID: 4548A08C.4060104@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> We are trying to get something faster than ~ '%foo%';
> Which Tsearch2 does not give us :)

Hmm, why not with GIN? :) Although, right now GIN doesn't support prefix search,
it's possible to use it.

Brain storm method:

Develop a dictionary which returns all substring for lexeme, for example for
word foobar it will be 'foobar fooba foob foo fo oobar ooba oob oo obar oba ob
bar ba ar'. And make GIN functional index over your column (to save disk space).
So, your query will be looked as
select ... where to_tsvector(text_column) @@ 'foo';
Notices:
Time of search in GIN weak depend on number of words (opposite to
tsearch2/GiST), but insertion of row may be slow enough....

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Moreno 2006-11-01 14:50:01 Re: Encoding, Unicode, locales, etc.
Previous Message Karsten Hilbert 2006-11-01 10:41:43 Re: Encoding, Unicode, locales, etc.

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2006-11-01 14:26:04 IN(subselect returning few values ...)
Previous Message luis garcia 2006-11-01 12:49:48 ¿¿¿past chunk end???