Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group