pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis Bjorklund <db@zigo.dhs.org>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Turn correlated in subquery into join
Date: Mon, 24 Mar 2008 12:30:11 -0400
Message-ID: <4995.1206376211@sss.pgh.pa.us> (raw)
In-Reply-To: <47E7567C.1090804@zigo.dhs.org>
References: <47E7567C.1090804@zigo.dhs.org>

Dennis Bjorklund <db@zigo.dhs.org> writes:
> Look like the mysql people found a subquery that postgresql doesn't 
> handle as good as possible:

>    http://s.petrunia.net/blog/

> Is there some deeper issue here that I fail to see or is it simply that 
> it hasn't been implemented but is fairly straigt forward?

I don't think it's straightforward: you'd need to do some careful
analysis to prove under what conditions such a transformation would be
safe.  If the answer is "always, it doesn't matter what the correlation
condition is" then the actual implementation would probably not be
tremendously difficult.  If there are restrictions then checking whether
the restrictions hold could be interesting ...

			regards, tom lane



view thread (2+ messages)

Message-ID: <4995.1206376211@sss.pgh.pa.us>
Permalink:  ../4995.1206376211@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4995.1206376211@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, db@zigo.dhs.org
  Subject: Re: Turn correlated in subquery into join
  In-Reply-To: <4995.1206376211@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox