Re: Searching for substring with tsearch(1/2)

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Urmo <urmo(at)xwm(dot)ee>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Searching for substring with tsearch(1/2)
Date: 2003-12-10 09:34:23
Message-ID: 1071048862.3194.39.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Teodor Sigaev kirjutas K, 10.12.2003 kell 11:20:
> >>Tsearch was never minded as prefix search, and index structure doesn't support
> >>any kind of prefix or suffix. But you can write extension to tsearch, which will
> >>search by prefix. But such solution wiil not use index, only sequence scan.
> >
> >
> > How efficient would tsearch be for really big expressions (where 'hu%'
> > would be expanded (using a btree word index on one column word table) to
> > tsearch equivalent of ( "human" or "humanity" or "humming" or "huge" or
> > ..1000 words here...) before passing the expression to tsearch?
>
> GiST index of tsearch doen't support prefix search, so it will works only by
> seqscan, as we know :) disk is much more slow than processor, speed will be
> limited by disk.

I meant that the expansion of 'hu%' is done before and outside of
tsearch, so the question is how efficient will tsearch be for searching
for hudreds or thousands of words in one expression.

> > How hard (or sensible ;) would be creating such an index using GiST ?
> > As proved by tsearch GiST can cope well with many-to-many indexes.
>
> Sorry, I don't understand. Do you mean that GiST supports one heap tuple in
> several index tuple? If yes then no :). GiST doesn't support this feature. I
> don't think that GiST may help in this situation.

but tsearch seems to support this, and tsearch uses GiST. Is this
functionality added entirely by tsearch ?

--------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2003-12-10 10:06:11 Re: Searching for substring with tsearch(1/2)
Previous Message Teodor Sigaev 2003-12-10 09:20:14 Re: Searching for substring with tsearch(1/2)