From: | Jesper Krogh <jesper(at)krogh(dot)cc> |
---|---|
To: | PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Using GIN/Gist to search the "union" of two indexes? |
Date: | 2010-03-05 09:46:39 |
Message-ID: | 4B90D2FF.1050008@krogh.cc |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2010-03-05 09:50:23 | Re: Visual Studio 2005, C-language function - avoiding hacks? |
Previous Message | Magnus Hagander | 2010-03-05 09:39:09 | Re: Explicit psqlrc |