spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ioana Delaney (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-23756) [Performance] Redundant join elimination
Date Tue, 20 Mar 2018 19:26:00 GMT
Ioana Delaney created SPARK-23756:
-------------------------------------

             Summary: [Performance] Redundant join elimination
                 Key: SPARK-23756
                 URL: https://issues.apache.org/jira/browse/SPARK-23756
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Ioana Delaney


This rewrite eliminates self-joins on unique keys. Self-joins may be introduced after view
expansion. 

*User view:*
{code}
create view manager(mgrno, income) as 
select e.empno, e.salary + e.bonus
from employee e, department d
where e.empno = d.mgrno;
{code}

*User query:*
{code}
select e.empname, e.empno
from employee e, manager m
where e.empno = m.mgrno and m.income > 100K
{code}

*Internal query after view expansion:*

{code}
select e.lastname, e.empno
from employee e, employee m, department d
where e.empno = m.empno /* PK = PK */ and e.empno = d.mgrno and 
m.salary + m.bonus > 100K
{code}

*Internal query after join elimination:*

{code}
select e.lastname, e.empno
from employee e, department d
where e.empno = d.mgrno and 
e.salary + e.bonus > 100K
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message