You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in tidb code, when we want to get some information from an execution plan, we have to implement a method for the planner/core.Plan type. Usually, we have to iterate through the tree in the method. And sometimes, we will collect some basic information in different places.
This causes some unnecessary repeated code and some bugs: #28731 Generating the execution plan text from a Plan is repeated for the EXPLAIN statement, statements summary, and slow log/slow query. And their results are different. #35687 The logic of iterating the plan tree is updated because of new operators, but only for EXPLAIN statements. The logic for stmt summary and the slow query/log is missed.
And we are still adding more methods to extract different information from Plan in different places. So it's better if we can make it more convenient and reduce repeated code.
Enhancement
Currently, in tidb code, when we want to get some information from an execution plan, we have to implement a method for the
planner/core.Plan
type. Usually, we have to iterate through the tree in the method. And sometimes, we will collect some basic information in different places.This causes some unnecessary repeated code and some bugs:
#28731 Generating the execution plan text from a
Plan
is repeated for theEXPLAIN
statement, statements summary, and slow log/slow query. And their results are different.#35687 The logic of iterating the plan tree is updated because of new operators, but only for
EXPLAIN
statements. The logic for stmt summary and the slow query/log is missed.And we are still adding more methods to extract different information from
Plan
in different places. So it's better if we can make it more convenient and reduce repeated code.A possible solution: #28731 (comment)
The text was updated successfully, but these errors were encountered: