Re: Index condition in a Nested Loop - Mailing list pgsql-performance

From Tom Lane
Subject Re: Index condition in a Nested Loop
Date
Msg-id 22245.1330388216@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index condition in a Nested Loop  (Mark Hills <mark@pogo.org.uk>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Mark Hills
Date:
Subject: Re: Index condition in a Nested Loop
Next
From: Stefan Keller
Date:
Subject: Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?