Coder Social home page Coder Social logo

matteogioioso / postgres-explain-web Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 12.36 MB

PostgreSQL query plan visualization

Home Page: https://postgres-explain.matteogioioso.com

HTML 0.59% JavaScript 12.79% Shell 0.17% TypeScript 86.44%
postgres postgresql query query-plan sql

postgres-explain-web's People

Contributors

matteogioioso avatar

Watchers

 avatar

postgres-explain-web's Issues

List of minor issues

  • Add Heap Fetches into indexes stats: https://www.pgmustard.com/docs/explain/heap-fetches
  • Warning colors for rows: https://explain.depesz.com/help#colors-rows
  • Some NodeType have additional info and Operation should include those. Ex: Nested Loop Join as Join Type: Anti, the operation name should be Nested Loop Anti Join. I think same should go for Left, Right joins
  • Big numbers should have , and . to be better visualized
  • Scroll to does not perfectly focus on the Row
  • Hover on table row will be voided by background color set on the cell (For example when warning color is displaying)
  • Add JIT stats
  • In the Node column Operation name will be indented if the nesting is too deep

[Explain web]: interface conversion: interface {} is string, not float64

{  "message": "query explain panic",  "error_details": "interface conversion: interface {} is string, not float64",  "stackTrace": "goroutine 6 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24  0x6\nmain.explain.func1.1()\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:24  0x18\npanic({0x16220, 0x429f80})\n\t/usr/local/go/src/runtime/panic.go:884  0x2c\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).calculateActuals(0x49dd20, 0x4288d0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:205  0x7c\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4288d0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:80  0x41\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428540)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428510)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4284e0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4284b0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428480)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428450)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428420)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).AnalyzePlan(0x49dd20, 0x428420, 0x49dc80)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:27  0x2\nmain.explain.func1({{}, 0x7ff8000100000005, 0x4100c8}, {0x40e0f0, 0x1, 0x1})\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:54  0x4b\nsyscall/js.handleEvent()\n\t/usr/local/go/src/syscall/js/func.go:94  0x26\n"}

https://explain.depesz.com/s/GmeM#source

[Explain web]: Issue with calculating plan 002

{  "message": "query explain panic",  "error_details": "interface conversion: interface {} is nil, not float64",  "stackTrace": "goroutine 6 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24  0x6\nmain.explain.func1.1()\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:24  0x18\npanic({0x16040, 0x428720})\n\t/usr/local/go/src/runtime/panic.go:884  0x2c\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*Summary).recurseNode(0x471e40, 0x428420, {0x41239202c20c49ba, 0x3fd570a3d70a3d71, 0x3ff0000000000000}, 0x0, {0x0, 0x0})\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/summary.go:52  0x66\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*Summary).Do(0x471e40, 0x428420, {0x41239202c20c49ba, 0x3fd570a3d70a3d71, 0x3ff0000000000000})\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/summary.go:27  0x2\nmain.explain.func1({{}, 0x7ff8000100000005, 0x4100c8}, {0x40e0f0, 0x1, 0x1})\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:53  0x4e\nsyscall/js.handleEvent()\n\t/usr/local/go/src/syscall/js/func.go:94  0x26\n"}

https://explain.depesz.com/s/CowZ#source

[Explain web]: interface conversion

{  "message": "query explain panic",  "error_details": "interface conversion: interface {} is string, not float64",  
"stackTrace": 
"goroutine 6 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24
 0x6\nmain.explain.func1.1()\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:24  
0x18\npanic({0x16220, 0x429f80})\n\t/usr/local/go/src/runtime/panic.go:884  
0x2c\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).calculateActuals(0x49dd20, 0x4288d0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:205  
0x7c\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4288d0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:80  
0x41\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428540)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428510)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4284e0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x4284b0)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  

0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428480)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428450)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).processNode(0x49dd20, 0x428420)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:75  
0x43\ngithub.com/MatteoGioioso/postgres-explain/pkg.(*PlanEnricher).AnalyzePlan(0x49dd20, 0x428420, 0x49dc80)\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/postgres-explain/pkg/plan_enricher.go:27  
0x2\nmain.explain.func1({{}, 0x7ff8000100000005, 0x4100c8}, {0x40e0f0, 0x1, 0x1})\n\t/home/mgioioso/Development/Contributions/postgres-explain-web/wasm/main.go:54  
0x4b\nsyscall/js.handleEvent()\n\t/usr/local/go/src/syscall/js/func.go:94  0x26\n"}

Error happens with the following plan: https://explain.depesz.com/s/N6aCS#source

Main features

  • Comprehensive Node Representation: Display each node in the query plan with detailed information, such as the type of operation (e.g., sequential scan, index scan), estimated and actual row counts, and cost estimates.
    Visual Hierarchy: Clearly present the parent-child relationships among nodes, allowing users to easily follow the flow of the query execution.

  • Execution Order Indication: Show the order in which nodes are executed, emphasizing the most critical or time-consuming operations.

  • Color-Coding and Highlighting: Use different colors or visual cues to differentiate between various types of nodes or highlight important components, such as expensive operations or high cardinality steps.

  • Join Visualization: Provide visual representations of join operations, indicating the join type (e.g., inner join, left outer join) and the join criteria (e.g., hash join, nested loop join).

  • Index Usage: Highlight the usage of indexes in the query plan, illustrating when and how they are utilized to optimize the execution.
    Data Distribution: Present statistics on data distribution during execution, indicating the number of rows passing through each operation and potential bottlenecks.

  • Statistics Display: Include relevant statistics such as execution time, memory usage, and disk I/O, allowing users to evaluate the performance of the query plan.

  • Interactive Exploration: Enable users to interact with the visualization, such as zooming, panning, and collapsing/expanding nodes, to explore the plan in detail and focus on specific aspects.

  • Side-by-Side Comparison: Allow users to compare multiple query plans simultaneously, facilitating performance analysis and identifying differences between alternative plans or query versions.

  • Export and Sharing: Provide options to export the visualization as an image or share it with others, enabling collaboration and documentation of query optimizations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.