Using GIN/Gist to search the "union" of two indexes?

Поиск
Список
Период
Сортировка
От Jesper Krogh
Тема Using GIN/Gist to search the "union" of two indexes?
Дата
Msg-id 4B90D2FF.1050008@krogh.cc
обсуждение исходный текст
Ответы Re: Using GIN/Gist to search the "union" of two indexes?  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
Hi.

How complicated would it be to make postgresql-fts search the "union" of
several GIN/Gist indexes.

The use-case is that you have two tables:

tablea(id serial, tableb_id int, text tsvector);
and
tableb(id serial, text tsvector);
and indices on both tsvectors.

The typical query would join the two tables on the key:

select id from tablea,tableb where tablea.tableb_id = tableb.id;

And then filter the results on the fts-indexes:

select id from tablea,tableb where tablea.tableb_id = tableb.id and
tablea.text @@ to_tsquery('ftsquery') or tableb.text @@
to_tsquery('ftsquery');

This one is doable .. using some "mocking" of queries in the
application. But if ftsquery is:

"terma & termb" where terma only exists in tablea and termb only exists
in tableb, then it doesn't work. The path would seem to be to "not use"
the indexes.

I guess it would be something like a new "ts_match_vq() that can take
more than one vector and get the underlying logik to do the union at
search time?

Can someone with more insigth into the code tell me if it is persieved a
"hard task" to do?

Thanks.
Jesper
-- 
Jesper


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Explicit psqlrc
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Visual Studio 2005, C-language function - avoiding hacks?