phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maryann Xue (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-945) Support correlated subqueries
Date Thu, 14 Aug 2014 03:08:11 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Maryann Xue updated PHOENIX-945:
--------------------------------

    Issue Type: Sub-task  (was: Task)
        Parent: PHOENIX-1167

> Support correlated subqueries
> -----------------------------
>
>                 Key: PHOENIX-945
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-945
>             Project: Phoenix
>          Issue Type: Sub-task
>    Affects Versions: 3.0.0, 4.0.0, 5.0.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>             Fix For: 3.0.0, 4.0.0, 5.0.0
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Example:
>  SELECT employee_number, name
>    FROM employees AS Bob
>    WHERE salary > (
>      SELECT AVG(salary)
>        FROM employees
>        WHERE department = Bob.department);
> Basically we can optimize these queries into join queries, like:
>  SELECT employees.employee_number, employees.name
>    FROM employees INNER JOIN
>      (SELECT department, AVG(salary) AS department_average
>        FROM employees
>        GROUP BY department) AS temp ON employees.department = temp.department
>    WHERE employees.salary > temp.department_average;



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message