sasha-alias / sqltabs

Rich SQL client for Postgresql, MySQL, MS SQL, Amazon Redshift, Google Firebase (Firestore)
https://www.sqltabs.com
GNU General Public License v3.0
803 stars 57 forks source link

Explain plan cost/time visualisation #93

Closed sasha-alias closed 7 years ago

sasha-alias commented 7 years ago

When analysing long query plans it's often hard to get which part is the most expensive. So adding some formatting and visualisation for EXPLAIN output. So far the development version looks like on a screenshot below. Further ideas are very appreciated

screen shot 2017-05-04 at 16 11 42

maury91 commented 7 years ago

I think the best will be a flowchart like the old SQL programs:

Flowchart

there's a nice library in react to create those flowcharts: https://github.com/projectstorm/react-diagrams

sasha-alias commented 7 years ago

Actually I'm not a big fan of a flowchart representation of explain plan. From my point of view it doesn't help to troubleshoot the things, especially when it comes to complicated queries with dozens of lines. And copy/paste with text works much better then with charts :) So far I added 2 diagrams to the plan nodes: inclusive cost/time and exclusive cost/time. This way it should be easier to identify from the quick look which part of the plan has the issues. Also I've made nodes collapsible, so you are able to hide a part of the plan you are not interested in (line 9 on the picture). And have made some text formatting for easier reading... Work is still in progress

screen shot 2017-05-09 at 16 08 47

sasha-alias commented 7 years ago

@maury91 thanks for pointing out the react-diagrams library. It looks very promising. I think it can be used for tackling ER Diagrams #20

sasha-alias commented 7 years ago

thanks to @tvondra there will be 2 views for explain plan :) feedback is very appreciated

screen shot 2017-05-18 at 09 36 25
tvondra commented 7 years ago

So my nagging while drinking beer worked? We need to go for a beer more often!

sasha-alias commented 7 years ago

yeah 🍺 actually being more on devops side I missed the use cases of consulting DBAs, that was useful to hear. @tvondra check this out http://explain.sqltabs.com/

sasha-alias commented 7 years ago

v0.18.0 released