explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W19

Settings
# exclusive inclusive rows x rows loops node
1. 116.701 5,158.973 ↑ 1.0 84,004 1

Sort (cost=1,460,528.12..1,460,738.13 rows=84,004 width=474) (actual time=5,135.078..5,158.973 rows=84,004 loops=1)

  • Sort Key: oh.inserted DESC, oh.send_order_date
  • Sort Method: external merge Disk: 21024kB
2. 165.631 5,042.272 ↑ 1.0 84,004 1

Hash Left Join (cost=7.95..1,435,565.86 rows=84,004 width=474) (actual time=5.638..5,042.272 rows=84,004 loops=1)

  • Hash Cond: (((SubPlan 3))::text = (os.constant)::text)
3. 25.461 76.186 ↑ 1.0 84,004 1

Hash Left Join (cost=6.79..3,162.10 rows=84,004 width=333) (actual time=0.062..76.186 rows=84,004 loops=1)

  • Hash Cond: (oh.ws_id = ws.id)
4. 40.750 50.715 ↑ 1.0 84,004 1

Hash Left Join (cost=5.47..2,873.53 rows=84,004 width=187) (actual time=0.045..50.715 rows=84,004 loops=1)

  • Hash Cond: (oh.visitor_id = v.id)
5. 9.935 9.935 ↑ 1.0 84,004 1

Seq Scan on order_head oh (cost=0.00..2,639.04 rows=84,004 width=155) (actual time=0.005..9.935 rows=84,004 loops=1)

6. 0.015 0.030 ↑ 1.1 99 1

Hash (cost=4.10..4.10 rows=110 width=36) (actual time=0.029..0.030 rows=99 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
7. 0.015 0.015 ↑ 1.1 99 1

Seq Scan on visitor v (cost=0.00..4.10 rows=110 width=36) (actual time=0.003..0.015 rows=99 loops=1)

8. 0.004 0.010 ↑ 1.0 14 1

Hash (cost=1.14..1.14 rows=14 width=150) (actual time=0.010..0.010 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.006 0.006 ↑ 1.0 14 1

Seq Scan on wholesaler ws (cost=0.00..1.14 rows=14 width=150) (actual time=0.005..0.006 rows=14 loops=1)

10. 0.003 0.005 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=292) (actual time=0.005..0.005 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.002 0.002 ↑ 1.0 7 1

Seq Scan on order_status os (cost=0.00..1.07 rows=7 width=292) (actual time=0.002..0.002 rows=7 loops=1)

12.          

SubPlan (forHash Left Join)

13. 84.004 252.012 ↑ 1.0 1 84,004

Aggregate (cost=8.45..8.46 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=84,004)

14. 168.008 168.008 ↑ 1.0 1 84,004

Index Scan using ra_order_item_order_id_idx on order_item (cost=0.42..8.44 rows=1 width=7) (actual time=0.002..0.002 rows=1 loops=84,004)

  • Index Cond: (order_id = oh.id)
15. 0.000 84.004 ↑ 1.0 1 84,004

Aggregate (cost=8.44..8.45 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=84,004)

16. 84.004 84.004 ↑ 1.0 1 84,004

Index Scan using ra_order_item_order_id_idx on order_item order_item_1 (cost=0.42..8.44 rows=1 width=2) (actual time=0.001..0.001 rows=1 loops=84,004)

  • Index Cond: (order_id = oh.id)
17. 4,464.434 4,464.434 ↑ 1.0 1 153,946

Result (cost=0.00..0.27 rows=1 width=32) (actual time=0.029..0.029 rows=1 loops=153,946)