Re: BUG #6335: Weird planner decision with exists (a join b) condition

From: bricklen <bricklen(at)gmail(dot)com>
To: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6335: Weird planner decision with exists (a join b) condition
Date: 2011-12-15 01:00:50
Message-ID: CAGrpgQ_k5B6bNHxE5aeuFBrb4Qn5ojKQB26GsUa=L85J-Ufp8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Dec 14, 2011 at 4:53 PM, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)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  select *
> from test1
> where
> test1.user_id in (100, 101)
> and exists (
> SELECT * from test2
> join test3 using (resume_id)
> where
> test2.user_id = test1.user_id
> );

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maxim Boguk 2011-12-15 01:28:13 Re: BUG #6335: Weird planner decision with exists (a join b) condition
Previous Message Maxim Boguk 2011-12-15 00:53:22 Re: BUG #6335: Weird planner decision with exists (a join b) condition