Projection while performing joins.

From: Anagh Lal <anaghlal2001(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Projection while performing joins.
Date: 2003-02-11 04:41:58
Message-ID: 20030211044158.5415.qmail@web14306.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
In the merge join as well as in the nested loop join,
we do ExecProject() after we have found tuples from
the relations involved in the join.
For a join query involving just two relations and
merge join being used, the outer plan will be
NodeSort. Now, NodeSort will create Temp files and
keep a sorted version of the relation in these Temp
files. (correct?)
I was wondering,
Why do we not just store the attributes required in
the join (i.e. those in the join qual conditions and
the ones in the select list) and then perform sorting
and retrieval on these tuples rather than on the
possibly larger tuples with more attributes which we
project out in the end anyway.

Is there any reason why this is infeasible to
implement
or is this simply a wrong approach theoretically?

If none, is this being used anywhere? (hope the
answers is not postgres... i would have embarrassed
myself no limit then)

Another way of putting this would be, why don't we
push the projection operator as far down as possible.
In this case we also add the attributes in the
selection operator (of relational algebra) to the
projection. And then perform a join on the smaller
resulting relation.

Regards,

Anagh Lal.

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-02-11 05:45:09 Re: Projection while performing joins.
Previous Message Tom Lane 2003-02-11 04:33:05 Re: log_duration