Re: Using GIN/Gist to search the "union" of two indexes?
В списке pgsql-hackers по дате отправления:
| От | Dimitri Fontaine |
|---|---|
| Тема | Re: Using GIN/Gist to search the "union" of two indexes? |
| Дата | |
| Msg-id | m2vdd9dvio.fsf@hi-media.com обсуждение исходный текст |
| Ответ на | Using GIN/Gist to search the "union" of two indexes? (Jesper Krogh <jesper@krogh.cc>) |
| Список | pgsql-hackers |
Jesper Krogh <jesper@krogh.cc> writes:
> 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.
You probably could maintain a separate "materialized" table with a
single tsvector for the two input tables, then query that vector
alone. Given the right foreign keys or copied data you'll get the
matched data easily too.
Hope this helps, regards,
--
dim
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера