Skip to content

Preetam/explain-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

explain-analyzer

Web-based analyzer for MySQL and PostgreSQL JSON EXPLAIN output.

Use it locally with npm run dev, or from GitHub Pages after deploying dist/.

Features

  • Table representation of MySQL / PostgreSQL JSON explain output
  • Comments about explain interpretation (full table scans, index usage, etc.)
  • Experimental scalability analysis
  • Automatic dialect detection

Try it

Paste either:

MySQLEXPLAIN FORMAT=JSON ...

{
  "query_block": {
    "select_id": 1,
    "cost_info": { "query_cost": "0.45" },
    "table": {
      "table_name": "test",
      "access_type": "ALL",
      "rows_examined_per_scan": 2,
      "rows_produced_per_join": 2,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "0.25",
        "eval_cost": "0.20",
        "prefix_cost": "0.45",
        "data_read_per_join": "16"
      },
      "used_columns": ["id"]
    }
  }
}

PostgreSQLEXPLAIN (FORMAT JSON) ...

[
  {
    "Plan": {
      "Node Type": "Seq Scan",
      "Relation Name": "test",
      "Alias": "test",
      "Startup Cost": 0.0,
      "Total Cost": 1.02,
      "Plan Rows": 2,
      "Plan Width": 4
    }
  }
]

Develop

npm install
npm run dev      # local server
npm test         # vitest
npm run build    # output in dist/

Deploy

Build, then publish the dist/ directory (for example with a gh-pages branch).

npm run build
# deploy contents of dist/

License

BSD 2-Clause (see LICENSE)

About

MySQL and PostgreSQL JSON Explain Analyzer

Resources

License

Stars

97 stars

Watchers

4 watching

Forks

Packages