Fulltext - multiple single column indexes

Поиск
Список
Период
Сортировка
От esemba
Тема Fulltext - multiple single column indexes
Дата
Msg-id 22611952.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: Fulltext - multiple single column indexes  (Richard Huxton <dev@archonet.com>)
Re: Fulltext - multiple single column indexes  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-general
Hi,
I have table with several columns and need to perform fulltext search over
volatile number of columns.
I can't use multicolumn gist index or gin index over concatenated columns,
so I've created several single column indexes (one for each column I want to
search) and now I need to query them like this:

to_tsvector('cs', coalesce(annotation, '')) || to_tsvector('cs',
coalesce(resume, '')) || ...
@@ to_tsquery('cs', 'Query text');

This query works, but EXPLAIN has shown me, that postgres doesn't use the
indexes, so the query over a table with several thousands of records last
very long time. I've figured out, that indexes probably cannot be used this
way. What is a recommendation for this scenario?
Indexes over static number of columns work fine, but I can't use them,
because in my application logic I want to let user choose which columns to
search.

Thank you for your reply.
--
View this message in context: http://www.nabble.com/Fulltext---multiple-single-column-indexes-tp22611952p22611952.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Special charaters
Следующее
От: ries van Twisk
Дата:
Сообщение: Re: Is there a meaningful benchmark?