Commit Graph

2 Commits

Author SHA1 Message Date
ca73684d10 [feature](tools)draw a graphic profile (#24495)
### how to get profile.png
1. execute a sql file, and draw its profile  
          python3 profile_viewer.py -f[path to sql file] -t [query title]

2. draw a given profile
          python3 profile_viewer.py -qid [query_id] -t [query title]
    
    graphviz is required(https://graphviz.org/)
    on linux: apt install graphviz
    on mac: brew install graphviz

### related changes
reimplement rest api: /profile/json/{query_id} to return profile in json format. currently, json profile only contains two counters: RowsReturned and TotalTime
2023-09-21 10:24:35 +08:00
0613ccda74 [feature](tools)profile viewer (#14429)
It is a painful work to read profile, especially there are multi-parallel instances.
This tool helps us to grasp the main information of profile in a graphical view.

The profile is represented by a tree.
Sql operation nodes contains operation type(join, scan...), its node id, its fragment id. The number on the arrow edge means how many rows output by child node. This tool will sum the output rows of the same node in multi-parallel instances, that is if there are 4 parallel instance, and each ScanNode on lineitem table output 10 rows, the label on the arrow beginning with ScanNode(lineitem) is 40.

Here is a demo for tpch Q2
tpch q2 profile viewer

Issue Number: close #xxx
2022-11-21 10:29:54 +08:00