spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ioana Delaney (JIRA)" <>
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
             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

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

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

*Internal query after view expansion:*

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

*Internal query after join elimination:*

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

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message