What do the numbers behind the execution plan operators represent?

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

Original topic: 执行计划算子后面的数字代表什么意思

| username: TiDBer_iLonNMYE

What do the numbers after the execution plan operators represent?

| username: HACK | Original post link

Sure, please provide the text you need translated.

| username: TiDBer_iLonNMYE | Original post link

Got it. My understanding is that the number doesn’t have much significance when analyzing the execution plan and doesn’t need special attention.

| username: 履霜知冰 | Original post link

The numbers following the execution plan operators basically indicate the execution order, and you also need to consider the keywords following the node IDs. Build always executes before Probe, and Build always appears before Probe. You can refer to the official documentation for a description of the execution order of operators:

| username: TiDBer_yyy | Original post link

This post also doesn’t explain the meaning of the numbers clearly.
If it’s not something to be concerned about, why has it been present in older versions like tidb3 and tidb4?

| username: TiDBer_yyy | Original post link

Borrowing this post to ask a question:
I can see numbers like 20, 21, 9, 19, 18, etc. below the execution plan.

  1. How are these numbers determined?
  2. How is the order of these numbers determined, for example, 18 and 19 are under 9, and 9 is under 21.
+------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------+
| id                           | estRows  | task      | access object | operator info                                                                                                          |
+------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------+
| StreamAgg_20                 | 1.00     | root      |               | funcs:count(Column#13)->Column#11                                                                                      |
| └─TableReader_21             | 1.00     | root      |               | data:StreamAgg_9                                                                                                       |
|   └─StreamAgg_9              | 1.00     | cop[tikv] |               | funcs:count(1)->Column#13                                                                                              |
|     └─Selection_19           | 250.00   | cop[tikv] |               | ge(bikeshare.trips.start_date, 2017-07-01 00:00:00.000000), le(bikeshare.trips.start_date, 2017-07-01 23:59:59.000000) |
|       └─TableFullScan_18     | 10000.00 | cop[tikv] | table:trips   | keep order:false, stats:pseudo                                                                                         |
+------------------------------+----------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)