SQLForge™

AL-DEV-07

PostgreSQL & MySQL EXPLAIN visualizer, ORM N+1 loop detector, SQL injection AST auditor, and index advisor. Zero-telemetry database diagnostics.

Aventine Labs

EXPLAIN Execution Plan

Format: JSONEngine: PostgreSQL

3 Critical Bottlenecks Detected

External Disk Sort Spill (14280 KB on Disk)HIGH

Sort operation spilled to disk (14280 kB used). work_mem exhausted.

💡 Fix: Increase Postgres work_mem for this session (e.g. SET work_mem = '64MB';) or create an index matching the sort key.
Sequential Scan on Table "orders"HIGH

Sequential scan on table "orders" (18,450 rows). Entire table read from storage.

💡 Fix: Create an index on orders covering columns referenced in: (status = 'COMPLETED'::text)
Heavy Post-Fetch Filter Discard (381,550 rows)HIGH

Heavy filter discards: 381,550 rows removed while returning only 18,450 rows.

💡 Fix: Consider indexing columns in "(status = 'COMPLETED'::text)" to filter rows at the B-tree index level instead of post-fetch heap filter.
Execution Time
146.42 ms
Total Cost
8420.8
Planning Time
1.25 ms
Bottlenecks
3

Execution Plan Hierarchy

Click any node to inspect details
Limit
Cost: 8420.8Time: 145.89 msRows: 50
100%
SortBottleneck
Cost: 8510.5Time: 144.92 msRows: 50
100%
Hash Join
Cost: 7250.3Time: 118.25 msRows: 18,450
86%
Seq Scanon ordersBottleneck
Cost: 4820.0Time: 74.32 msRows: 18,450
57%
Hash
Cost: 1450.0Time: 24.12 msRows: 52,000
17%
Index Scanon customersusing idx_customers_tier
Cost: 1450.0Time: 16.45 msRows: 52,000
17%