Skip to content
  • Chaithra Gopalareddy's avatar
    8fda114b
    WL#13520: Transform correlated scalar subqueries · 8fda114b
    Chaithra Gopalareddy authored
    This worklog extends the support for transformations of subqueries
    to derived tables with joins for correlated scalar subqueries.
    
    For an eligible correlated scalar subquery, the subquery is
    converted into a derived table with grouping added on
    the non-correlated field of the predicate. The correlated
    predicate is lifted out from the derived table and the
    non-correlated field is replaced with the field in the
    derived table. The derived table is outer joined on the
    lifted predicate in order to select the right group to
    match up the outer row. A cardinality check is also added
    to see if any of the groups in the derived table produced
    more than one row.
    
    The transformation is controlled by the the optimizer switch
    "subquery_to_derived". It is on by default for secondary
    engines like RAPID. But could be enabled for primary engines
    like Innodb.
    
    For further details, see the worklog page.
    
    Author: Dag Wanvik <dag.wanvik@oracle.com>
    Approved by : Roy lyseng <roy.lyseng@oracle.com>
    8fda114b
    WL#13520: Transform correlated scalar subqueries
    Chaithra Gopalareddy authored
    This worklog extends the support for transformations of subqueries
    to derived tables with joins for correlated scalar subqueries.
    
    For an eligible correlated scalar subquery, the subquery is
    converted into a derived table with grouping added on
    the non-correlated field of the predicate. The correlated
    predicate is lifted out from the derived table and the
    non-correlated field is replaced with the field in the
    derived table. The derived table is outer joined on the
    lifted predicate in order to select the right group to
    match up the outer row. A cardinality check is also added
    to see if any of the groups in the derived table produced
    more than one row.
    
    The transformation is controlled by the the optimizer switch
    "subquery_to_derived". It is on by default for secondary
    engines like RAPID. But could be enabled for primary engines
    like Innodb.
    
    For further details, see the worklog page.
    
    Author: Dag Wanvik <dag.wanvik@oracle.com>
    Approved by : Roy lyseng <roy.lyseng@oracle.com>
Loading