-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planner: support explain plan in JSON format #39261
Comments
+1 to this enhancement. |
GitHub uses the reactions to the issue description when filtering and sorting. Please add a 👍 to the issue description to vote for this issue. |
I would suggest to change the title to "planner: support MySQL compatible JSON explain format". The benefits and disadvantages for
The benefits and disadvantages of
Note that MySQL also has |
This shows the It is now like this: "executeInfo": "time:127.2µs, loops:2, RU:0.000000, build_hash_table:{total:40.7µs, fetch:32.7µs, build:8.09µs}, probe:{concurrency:5, total:25.2µs, max:20.6µs, probe:16.4µs, fetch:8.81µs}", It probably should be like this: "executeInfo": {"time":"127.2µs", "loops":2, "RU":0.000000, "build_hash_table":{"total":"40.7µs", "fetch":"32.7µs", "build":"8.09µs"}, "probe":{"concurrency":5, "total":"25.2µs", "max":"20.6µs", "probe":"16.4µs", "fetch":"8.81µs"}", (not sure if the values should be strings here with the unit (µs) or if they unit should be part of the key (e.g. "fetch_ms") |
Do you want a MySQL compatible JSON explain output or the TiDB explain output, but with |
For now, the TIDB explain output as JSON, including the full |
Also, I agree with encoding the unit either in the key name or as another k:v at the same depth, eg |
In #47401 I make some changes that do some of this. Note that this is just a early draft, not something that's ready and/or complete. |
@dveeden that looks good to me - JSON all the way down. |
Enhancement
JSON is a language-independent format for data exchange and easy to decode. With this format, optimizer plan can be easily decoded, as well as easy integration with 3rd party tools. It was supported in MySQL since 5.6. In order to improve scalability and compatibility, we need a JSON format output of explain result.
Notice: this json format is not same with MySQL‘s, we use
format = tidb_json
distinguishTODO
executeInfo
andoperatorInfo
can be show as JSON format rather than string, but we need add JSON tag for each operatorThe text was updated successfully, but these errors were encountered: