SQL Statements Contain the in Constant and No Result Is Returned After SQL Statement Execution
Symptom
The in constant is one of the criteria of the SQL statement for filtering large tables. There are more than 2000 constants. The base table contains a large amount of data. No result is returned after the SQL statement is executed.
Possible Causes
The in condition still exists as a common filtering condition in the execution plan. In this scenario, the performance of the join operation is better than that of the in constant. You need to use the join operation instead of the in constant for better performance.
Cause Analysis
- Print the statement execution plan.
- The in condition still exists as a common filtering condition in the execution plan. In this scenario, the performance of the join operation is better than that of the in constant. You need to use the join operation instead of the in constant for better performance.
Handling Procedure
- The default value of qrw_inlist2join_optmodeqrw_inlist2join_optmode is cost_base. You can change the in constant to a join operation. If the number of rows estimated by the optimizer is inaccurate, the value of the parameter may not be changed in some scenarios, resulting in poor performance.
- To solve this problem, set qrw_inlist2join_optmode to rule_base.
1
set qrw_inlist2join_optmode to rule_base;
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