Re: "WHERE 1 = 2 OR ..." makes planner choose a very inefficient plan - Mailing list pgsql-performance

From Richard Huxton
Subject Re: "WHERE 1 = 2 OR ..." makes planner choose a very inefficient plan
Date
Msg-id 51700688.4050505@archonet.com
Whole thread Raw
In response to "WHERE 1 = 2 OR ..." makes planner choose a very inefficient plan  (dmitry potapov <potapov.dmitry@gmail.com>)
List pgsql-performance
On 18/04/13 15:20, dmitry potapov wrote:
> Hello,
>
> I recently stumbled upon on what could be a planner bug or a corner
> case. If "<false condition> OR ..." is added to WHERE clause of SELECT
> query, then the planner chooses a very inefficient plan. Consider a query:

> If I comment out "1=2 OR", then the plan changes dramatically:

What happens if you substitute:
1. 1=3   OR
2. false OR

--
   Richard Huxton
   Archonet Ltd


pgsql-performance by date:

Previous
From: dmitry potapov
Date:
Subject: "WHERE 1 = 2 OR ..." makes planner choose a very inefficient plan
Next
From: Tom Lane
Date:
Subject: Re: "WHERE 1 = 2 OR ..." makes planner choose a very inefficient plan