What are the query transformations in ORACLE
This article focuses on "what are the query transformations in ORACLE". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "what are the query transformations in ORACLE"?
1. Sub-query expansion (subquery unnesting)
There are two types of subquery expansion:
1. Either disassemble the table or view in the subquery to join with the outer table
2. either do not open the subquery, but join it to the outer table as an embedded view
Not all subqueries will do subquery expansion, and the conditions for subquery expansion
1. The expanded SQL of the subquery must be completely equivalent to the original SQL.
2. The subquery is not taken apart, but is expanded as a subquery with embedded view, and the rewritten SQL cost should be less than the original SQL.
The where condition before the subquery is one of the following conditions, so if certain conditions are met, the subquery will be expanded.
Single-row (that is, =, > =