SQL Execution Plan Visualizer

📘 MySQL EXPLAIN ANALYZE 📘 PostgreSQL EXPLAIN Docs

Tree View

Table View

# Operation Cost Actual Time

🚀 Optimization Tips

🚩 Rule of Thumb

Situation Optimization Tip
High loops, low rows Investigate the outer loop — maybe it's joining without an index
High rows, low loops Could be okay if it's a single scan — try adding WHERE clauses or LIMIT
High both 🚨 Major red flag — possible cross joins or missing filters/indexes

📊 Which is Better for Optimization?

  • ✅ Fewer Loops is usually better than fewer rows.
  • Loops often indicate nested operations like joins.
  • High loops often mean repetitive execution, due to:
    • Nested Loop Joins (bad for large datasets unless indexed)
    • Lack of proper indexes
    • Cartesian joins (worst case)
  • ✅ Fewer Rows is also good — but not at the cost of many loops.
  • Too many rows can:
    • Increase memory usage
    • Increase sorting time
    • Trigger disk spills (if large enough)