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

WIP patch to add "placeholder" variables to planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: WIP patch to add "placeholder" variables to planner
Date: 2008-10-20 20:38:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Per earlier discussion,
I've been fooling around with a patch to let the planner evaluate
some expressions at lower join levels and bubble the results up
like Vars.  I've got it passing the regression tests now, and though
there is more left to do I thought it'd be worth posting for comment.

One thing I'm not totally satisfied with is that I've got each instance
of a PlaceHolderVar carrying a copy of the represented expression.
This seems a bit inefficient, but it's difficult to get rid of it
without making things a lot more fragile.  There are a lot of properties
of an expression tree (for example, whether it contains any volatile
functions) that are currently extracted on-demand using recursive tree
walkers.  So we'd need walkers to be able to descend through a
PlaceHolderVar in any case, and once you buy into that it's hard to
not say the same for mutators, so there can't just be a single shared
copy of the expression.  The only significant drawback I've found is
that if the expression contains a sub-SELECT you end up with some
useless extra copies of the resulting subplan.  Which is annoying but
it isn't really going to cost anything at runtime, and the case seems
unlikely to occur much in practice anyhow.

Comments anyone?

			regards, tom lane

Attachment: placeholders-1.patch.gz
Description: application/octet-stream (20.1 KB)

pgsql-hackers by date

Next:From: Simon RiggsDate: 2008-10-20 20:39:23
Subject: Re: [HACKERS] Hot Standby utility and administrator functions
Previous:From: Tom LaneDate: 2008-10-20 20:22:59
Subject: Re: Patch status for reducing de-TOAST overhead?

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