From: Tom Lane <tgl@sss.pgh.pa.us>
To: Benoit Delbosc <bdelbosc@nuxeo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow fulltext query plan
Date: Thu, 12 Apr 2012 18:25:59 -0400
Message-ID: <6273.1334269559@sss.pgh.pa.us> (raw)
In-Reply-To: <4F875293.1000100@nuxeo.com>
References: <4F875293.1000100@nuxeo.com>
Benoit Delbosc <bdelbosc@nuxeo.com> writes:
> EXPLAIN ANALYZE SELECT hierarchy.id
> FROM hierarchy
> JOIN fulltext ON fulltext.id = hierarchy.id,
> TO_TSQUERY('whatever') query1,
> TO_TSQUERY('whatever') query2
> WHERE (query1 @@ nx_to_tsvector(fulltext.fulltext)) OR (query2 @@
> nx_to_tsvector(fulltext.fulltext_title));
Is there a reason why you're writing the query in such a
non-straightforward way, rather than just
EXPLAIN ANALYZE SELECT hierarchy.id
FROM hierarchy
JOIN fulltext ON fulltext.id = hierarchy.id
WHERE (TO_TSQUERY('whatever') @@ nx_to_tsvector(fulltext.fulltext))
OR (TO_TSQUERY('whatever') @@ nx_to_tsvector(fulltext.fulltext_title));
?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, bdelbosc@nuxeo.com
Subject: Re: Slow fulltext query plan
In-Reply-To: <6273.1334269559@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox