Describes the nesting of subqueries on a derived table.
( nested ( derived_table ) ( subquery_specification ) )
is the derived table over which to nest the specified subquery.
is the subquery to nest over derived_table
A derived table.
select c11 from t1 where c12 = (select c21 from t2 where c22 = t1.c11)
( nested ( t_scan t1 ) ( subq 1 ( t_scan ( table t2 ( in ( subq 1 ) ) ) ) ) )
A single nested subquery.
select c11 from t1 where c12 = (select c21 from t2 where c22 = t1.c11) and c12 = (select c31 from t3 where c32 = t1.c11)
( nested ( nested ( t_scan t1 ) ( subq 1 ( t_scan ( table t2 ( in ( subq 1 ) ) ) ) ) ) ( subq 2 ( t_scan ( table t3 ( in ( subq 2 ) ) ) ) ) )
The two subqueries are both nested in the main query.
select c11 from t1 where c12 = (select c21 from t2 where c22 = (select c31 from t3 where c32 = t1.c11))
( nested ( t_scan t1 ) ( subq 1 ( nested ( t_scan ( table t2 ( in ( subq 1 ) ) ) ) ( subq 2 ( t_scan ( table t3 ( in ( subq 2 ) ) ) ) ) ) ) )
A level 2 subquery nested into a level 1 subquery nested in the main query.
The subquery is executed at the specified attachment point in the query plan.
Materialized and flattened subqueries do not appear under a nested operator. See subq for examples.