Re: Subquery in a JOIN not getting restricted?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: "Jay Levitt" <jay(dot)levitt(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Subquery in a JOIN not getting restricted?
Date: 2011-11-09 20:20:00
Message-ID: 4EBA8C100200002500042C23@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:

> Well, this may not fit the OP's 'real' query

Right, if I recall correctly, the OP said it was simplified down as
far as it could be and still have the issue show.

> but the inner subquery is probably better written as a semi-join
> (WHERE EXISTS).

Well, that doesn't mean that we shouldn't try to optimize perfectly
valid alternative spellings. Having each logically equivalent way
to write a query generate a different plan is far worse than hints
that are more clearly written. ;-)

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jay Levitt 2011-11-09 20:39:14 Re: Subquery in a JOIN not getting restricted?
Previous Message Merlin Moncure 2011-11-09 19:50:28 Re: Subquery in a JOIN not getting restricted?