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