Re: How to use Logical Operators in Fulltext Search?

From: Sam Jas <samjas33(at)yahoo(dot)com>
To: "pgsql-general(at)postgresql(dot)org mailing list" <pgsql-general(at)postgresql(dot)org>, Gaini Rajeshwar <raja(dot)rajeshwar2006(at)gmail(dot)com>
Subject: Re: How to use Logical Operators in Fulltext Search?
Date: 2009-10-21 13:24:34
Message-ID: 399400.44133.qm@web95013.mail.in2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Can we have a explain plan SELECT doc_id FROM docs WHERE tsv_title($$'magnetic induction'$$) OR
tsv_body($$'magnetic induction'$$) OR tsv_abstract($$'abstract'$$)

--
Thanks
Sam

--- On Wed, 21/10/09, Gaini Rajeshwar <raja(dot)rajeshwar2006(at)gmail(dot)com> wrote:

From: Gaini Rajeshwar <raja(dot)rajeshwar2006(at)gmail(dot)com>
Subject: [GENERAL] How to use Logical Operators in Fulltext Search?
To: "pgsql-general(at)postgresql(dot)org mailing list" <pgsql-general(at)postgresql(dot)org>
Date: Wednesday, 21 October, 2009, 1:12 PM

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 ?
 

Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Jas 2009-10-21 13:28:04 Re: How to use Logical Operators in Fulltext Search?
Previous Message Gaini Rajeshwar 2009-10-21 13:12:49 How to use Logical Operators in Fulltext Search?