pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Hills <mark@pogo.org.uk>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index condition in a Nested Loop
Date: Mon, 27 Feb 2012 19:16:56 -0500
Message-ID: <22245.1330388216@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.LNX.2.01.1202272211230.12105@stax.localdomain>
References: <alpine.LNX.2.01.1202261358070.31287@stax.localdomain>
	<16098.1330290020@sss.pgh.pa.us>
	<alpine.LNX.2.01.1202272211230.12105@stax.localdomain>

Mark Hills <mark@pogo.org.uk> writes:
> I hadn't realised that sub-queries restrict the planner so much. Although 
> at some point I've picked up a habit of avoiding them, presumably for this 
> reason.

> If you have time to explain, I'd be interested in a suggestion for any 
> change to the planner that could make a small contribution towards 
> improving this. eg. a small project that could get me into the planner 
> code.

Well, if it were easy to do, we'd probably have done it already ...

Plain subqueries might perhaps be turned into joins (with special join
types no doubt), but I'm not sure what we'd do about subqueries with
grouping or aggregation, as your examples had.  There was some talk a
month or three back about allowing such subqueries to have parameterized
paths a la the recently-added parameterized path mechanism, but it
didn't get further than idle speculation.

			regards, tom lane



view thread (4+ messages)

Message-ID: <22245.1330388216@sss.pgh.pa.us>
Permalink:  ../22245.1330388216@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22245.1330388216@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, mark@pogo.org.uk
  Subject: Re: Index condition in a Nested Loop
  In-Reply-To: <22245.1330388216@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