Similarity search with the tsearch2 extension
От | Janek Sendrowski |
---|---|
Тема | Similarity search with the tsearch2 extension |
Дата | |
Msg-id | trinity-de58bc2b-0ed7-49fc-86e9-c5a4df0994e0-1386340257615@3capp-webde-bs33 обсуждение исходный текст |
Ответы |
Re: Similarity search with the tsearch2 extension
|
Список | pgsql-performance |
Hi, I want to realize a Full Text Search with the tsearch2 extension. It should find similar sentences. I used my own trigger to store the tsvector of the sentences and I created a usual gist index on them. I have to to use many OR statements with a low set of arguments, what heavy damages the performance. My former query looked like this: SELECT strip(to_tsvector('The tiger is the largest cat species, reaching a total body length of up to 3.3 m and weighingup to 306 kg.')); strip ---------------------------------------------------------------------------------------------- '3.3' '306' 'bodi' 'cat' 'kg' 'largest' 'length' 'm' 'reach' 'speci' 'tiger' 'total' 'weigh' (1 row) SELECT * FROM tablename WHERE vector @@ to_tsquery('speci & tiger & total & weigh') AND vector @@ to_tsquery('largest & length & m & reach') ANDvector @@ to_tsquery('3.3 & 306 & bodi & cat & kg'); And thats very slow. Is there a better solution like a functional index? Thank you for your help. Janek Sendrowski
В списке pgsql-performance по дате отправления: