Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 来自小白的提问:怎么判断 SQL 需不需要拆分?
How to determine if SQL needs to be split?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 来自小白的提问:怎么判断 SQL 需不需要拆分?
How to determine if SQL needs to be split?
The data volume of a single operation is too large, causing an OOM (Out of Memory) error, so you need to find a way to split it.
The question is not well-phrased. It should be, how can I tell if the SQL is too large?
Let’s first look at the execution plan. If the number of rows retrieved is too large, consider splitting it.
Expensive SQL with long execution time or high resource consumption is called a large SQL.
If you’re a brother, just cut me once! I am “Zha Zha Hui”
When I see a subquery and the SQL is slow, I usually suggest getting the result of the subquery first and then processing the logic outside the subquery.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.