How to use Logical Operators in Fulltext Search?

Поиск
Список
Период
Сортировка
От Gaini Rajeshwar
Тема How to use Logical Operators in Fulltext Search?
Дата
Msg-id 56b36eb60910210612w568557cbrea8a89e1bcff63a9@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to use Logical Operators in Fulltext Search?  (Sam Jas <samjas33@yahoo.com>)
Re: How to use Logical Operators in Fulltext Search?  (Sam Jas <samjas33@yahoo.com>)
Re: How to use Logical Operators in Fulltext Search?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi All,
 
I am doing a fulltext search something like this:
 
SELECT doc_id FROM docs WHERE tsv_title($$'magnetic induction'$$) OR tsv_body($$'magnetic induction'$$) OR tsv_abstract($$'abstract'$$)
 
It is taking approximately 100 secs to execute.
 
But running the query on individual column something like below is taking just few milliseconds
 
1) SELECT doc_id FROM docs WHERE tsv_title($$'magnetic induction'$$) 
 
2) SELECT doc_id FROM docs WHERE tsv_body($$'magnetic induction'$$)
 
3) SELECT doc_id FROM docs WHERE tsv_abstract($$'magnetic induction'$$)
 
 
All the above queries are taking just few milliseconds, whereas the bigining one taking around 100 secs.
 
Does anyone know, what could be wrong in this? Is this not the way to specify logical operators like AND, OR, NOT ?
 

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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Index Scan/Bitmap Index Scan for queries with FTS and ORDER+LIMIT
Следующее
От: Sam Jas
Дата:
Сообщение: Re: How to use Logical Operators in Fulltext Search?