Question from a beginner: 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 需不需要拆分?

| username: Billmay表妹

How to determine if SQL needs to be split?

| username: 考试没答案 | Original post link

What does “拆分” mean?? Rewrite?

| username: Hacker007 | Original post link

Segmented execution? Writing to an intermediate table?

| username: caiyfc | Original post link

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.

| username: Billmay表妹 | Original post link

The question is not well-phrased. It should be, how can I tell if the SQL is too large?

| username: 孤君888 | Original post link

Check if the amount of scanned data is large.

| username: tidb菜鸟一只 | Original post link

Let’s first look at the execution plan. If the number of rows retrieved is too large, consider splitting it.

| username: Kongdom | Original post link

Expensive SQL with long execution time or high resource consumption is called a large SQL.

| username: xingzhenxiang | Original post link

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.

| username: Billmay表妹 | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.