Execution Plan Operator

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 执行计划算子

| username: 胡杨树旁

When looking at the execution plan, there are some parts that I don’t quite understand.

  1. What does the operator Projection_63 represent?
| username: 胡杨树旁 | Original post link

Is the interpretation process for this part as follows:

  1. Execute IndexRangeScan_52 first,
  2. Then execute Selection_54 (Build),
  3. Execute TableRowIDScan_53,
  4. Execute Selection_55 (Probe),
  5. Combine the results of the first and third steps?
| username: Billmay表妹 | Original post link

Refer to this: TiDB 执行计划概览 | PingCAP 文档中心

| username: 数据小黑 | Original post link

Official 302 course mnemonic: From right to left, from top to bottom

| username: 胡杨树旁 | Original post link

After reading this mnemonic, I still find it a bit difficult to use. Based on my understanding, it should be 52 —> 54, then execute 53 —> 55. However, looking at the sequence numbers, it doesn’t quite match…

| username: 胡杨树旁 | Original post link

According to the understanding, it should be 52 —> 54, then execute 53 —> 55, but looking at the sequence numbers, it doesn’t quite match…

| username: Billmay表妹 | Original post link

Your understanding is correct, it’s just a matter of numbering.

| username: forever | Original post link

From right to left, from top to bottom.
Looking from top to bottom, 56 is the rightmost and has no peer operator, so 56 starts executing. 54 and 55 are indented the same to the right, so 54 goes first. Within operator 54, 52 is to the right, so 52 executes first. After the first level of 54 is done, it’s 55’s turn, and 53, being to the right, goes first.

The ID doesn’t follow any specific pattern as long as it is unique. However, when generating the execution plan, there is a counter that increments by 1 after generating a plan ID. The execution order is not related to the sequence number. The entire execution plan is a tree, and execution starts from the root node, continuously returning data upwards.

SQL Operation FAQs | PingCAP Docs

| username: 胡杨树旁 | Original post link

Okay, got it. Thank you.

| username: alfred | Original post link

Top rightmost