Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 两台tidb-server执行计划不一致

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] v5.3.0
[Reproduction Path] Perform analyze on one of the tidb-servers, and the SQL execution plan on the other server is incorrect, leading to slow queries.
[Encountered Problem: Phenomenon and Impact] Execution plan inconsistency
- First tidb-server
Performed analyze on a table on one of the tidb-servers, and the query execution plan on the other tidb-server is incorrect (pseudo).
Here is the screenshot:
(root@10.30.2.49:4000) [noah_tidb]> analyze table yangzai_wxhc_sub_biz_order;
Query OK, 0 rows affected, 1 warning (1 min 20.91 sec)
(root@10.30.2.49:4000) [noah_tidb]> explain analyze SQL statement
The result is as follows:
- Second tidb-server
What is the reason for this? The execution plans on the two tidb-servers are inconsistent. Do I need to perform analyze on both servers separately?