Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 关于sql执行计划顺序怎么看
【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】7.5
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Issue Phenomenon and Impact】
For example, in the following execution plan, I think TableFullScan_163 is executed first, is that correct?
First, execute 179, refer to: TiDB 执行计划概览 | PingCAP 文档中心
I don’t quite understand this part.
The first to be executed is 179, you can refer to Oracle’s execution plan.
The image you provided is not visible. Please provide the text you need translated.
Is this the correct understanding:
├─Selection_173(Build)
└─HashJoin_120(Probe)
These two are at the same indentation level, with Build being executed first, so Selection_173(Build) is executed first, and then the most indented TableFullScan_179 is executed.
Build always executes before Probe, with the same level of indentation, first build then probe.
Simply put, it’s from right to left, from bottom to top. It should be noted that some of them are executed in parallel, without any particular order.
According to Oracle’s principle of executing the rightmost and deepest first, it should be 163 because it is the rightmost and has the deepest indentation.
Personally, I prefer 151. When multiple tables are joined, they are joined two by two. According to the hash join level, 151 is the innermost.
The Oracle client has a similar step-by-step function to view the execution plan order. I wonder if TiDB will release a similar GUI client.
According to the TiDB manual, it executes concurrently. I thought about converting the execution plan into a binary tree. 179, 163, 151, 154, and 170 are five leaf nodes, which should be able to execute simultaneously, regardless of the order.
Well, theoretically, concurrent execution in a distributed environment is the most scientific approach.
Oracle might be queuing at the underlying level because most of its execution is local.
I feel that the execution plan is a bit strange. Why is the area I highlighted not aligned?
It might be a display issue.
The execution order of operators
For the same level, process from top to bottom; for different levels, process from right to left.
It should be an issue with the tool’s UI display.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.