Hints Specifying Not to Expand Subqueries
Function
When the database optimizes the query logic, some subqueries can be promoted to the upper layer to avoid nested execution. However, for some subqueries that have a low selection rate and can use indexes to filter access pages, nested execution does not cause too much performance deterioration, while after the promotion, the query search scope is expanded, which may cause performance deterioration. In this case, you can use the no_expand hint for debugging. This hint is not recommended in most cases.
Syntax
1
|
no_expand[(@queryblock)] |
Parameter Description
For details about @queryblock, see Hint Specifying the Query Block Where the Hint Is Located. This parameter can be omitted, indicating that it takes effect in the current query block. If it is not specified, no_expand does not have parentheses (()).
Example
Normal query execution:
1
|
explain select * from t1 where t1.c1 in (select t2.c1 from t2); |
Plan
After no_expand is added:
1
|
explain select * from t1 where t1.c1 in (select /*+ no_expand*/ t2.c1 from t2); |
Plan
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot