What is a nested subquery? in which order does sql evaluate nested subqueries?
Subqueries are nested when they appear in the Show Subquery unnesting unnests and merges the body of the subquery into the body of the statement that contains it, allowing the optimizer to consider them together when evaluating access paths and joins. The optimizer can unnest most subqueries, with some exceptions. Those exceptions include hierarchical subqueries and subqueries that contain a Assuming no restrictions exist, the optimizer automatically unnests some (but not all) of the following nested subqueries:
You can enable extended subquery unnesting by instructing the optimizer to unnest additional types of subqueries:
|