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

Re: Join Removal/ Vertical Partitioning

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Join Removal/ Vertical Partitioning
Date: 2008-06-26 17:42:49
Message-ID: 18593.1214502169@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> We can check for removal of a rel by

> 1. inspecting the target list for the query to see if there are rels
> that do not provide any attributes. (We might also use equivalence
> classes to recode the targetlist to minimise the numbers of tables
> touched, but I think that might be overkill). 

More to the point, it would be wrong.  Equivalence classes do not imply
that two values considered equivalent are equal for all purposes, and
since we don't know what the client is going to do with the returned
data, we can't substitute some other value for the one requested.

> So some thoughts on where to attempt this would be very useful.

The hard part of this is figuring out where to do the work.  As you say,
doing it during prepjointree seems the nicest from an abstract code
structure point of view, but it requires a lot of information that is
not derived until later.

It might be possible to treat "ignore the RHS" as a join strategy and
try to apply it while forming join relations, which would be late enough
to have all the needed info available.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2008-06-26 18:16:03
Subject: Re: Planner creating ineffective plans on LEFT OUTERjoins
Previous:From: Tom LaneDate: 2008-06-26 17:33:02
Subject: Re: plpgsql: Is ELSE IF supported or not?

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