Re: BUG #6335: Weird planner decision with exists (a join b) condition - Mailing list pgsql-bugs

From bricklen
Subject Re: BUG #6335: Weird planner decision with exists (a join b) condition
Date
Msg-id CAGrpgQ_k5B6bNHxE5aeuFBrb4Qn5ojKQB26GsUa=L85J-Ufp8A@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6335: Weird planner decision with exists (a join b) condition  (Maxim Boguk <maxim.boguk@gmail.com>)
Responses Re: BUG #6335: Weird planner decision with exists (a join b) condition
List pgsql-bugs
On Wed, Dec 14, 2011 at 4:53 PM, Maxim Boguk <maxim.boguk@gmail.com> wrote:
> Here goes self-contained test case.
>
> I tested it on the 9.1.2, 9.1.1, 9.0.5, 9.0.4, 8.4.7

I just tested on 9.1.2 and see the same issue.

> --bad
> EXPLAIN ANALYZE=C2=A0 select *
> from test1
> where
> test1.user_id in (100, 101)
> and exists (
> SELECT * from test2
> join test3 using (resume_id)
> where
> test2.user_id =3D test1.user_id
> );

Setting enable_hashjoin to false pushes it back to a good plan again.

pgsql-bugs by date:

Previous
From: Maxim Boguk
Date:
Subject: Re: BUG #6335: Weird planner decision with exists (a join b) condition
Next
From: Maxim Boguk
Date:
Subject: Re: BUG #6335: Weird planner decision with exists (a join b) condition