Re: Full Text index is not using during OR operation for multiple table join - Mailing list pgsql-bugs

From Robert Haas
Subject Re: Full Text index is not using during OR operation for multiple table join
Date
Msg-id AANLkTi=xjf4J6YJx9oMHQ=7ZZnNRnvE_BVtD+XrojNVc@mail.gmail.com
Whole thread Raw
In response to Full Text index is not using during OR operation for multiple table join  (AI Rumman <rummandba@gmail.com>)
List pgsql-bugs
On Mon, Nov 29, 2010 at 5:27 AM, AI Rumman <rummandba@gmail.com> wrote:
> Full Text index is not using during OR operation for multiple table join:

Hmm.  If you have a condition of the form

<some-expression-involving-table-A> OR <some-expression-involving-table-B>

....then the system is going to have to join those tables before
evaluating that condition.  It can't scan A and throw away rows that
don't match the first part of the condition, because they might match
the second prong, and visca versa.

You can sometimes speed these queries up by rewriting them as a UNION
ALL query.  Maybe it'd be nice to make the planner consider such plans
automatically, but that'd be tricky to make work, I think.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: BUG #5798: Some weird error with pl/pgsql procedure
Next
From: Christopher Head
Date:
Subject: Re: BUG #5559: Full SSL verification fails when hostaddr provided