explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Od4a

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 152.724 ↓ 8.5 17 1

Hash Left Join (cost=343.18..357.92 rows=2 width=124) (actual time=152.690..152.724 rows=17 loops=1)

  • Hash Cond: (o.id = o_4.id)
2. 0.014 143.421 ↓ 8.5 17 1

Hash Left Join (cost=274.63..289.35 rows=2 width=92) (actual time=143.391..143.421 rows=17 loops=1)

  • Hash Cond: (o.id = o_3.id)
3. 0.023 142.327 ↓ 8.5 17 1

Hash Left Join (cost=207.90..222.60 rows=2 width=60) (actual time=142.300..142.327 rows=17 loops=1)

  • Hash Cond: (o.id = o_2.id)
4. 0.020 0.779 ↓ 8.5 17 1

Hash Left Join (cost=64.09..78.78 rows=2 width=28) (actual time=0.757..0.779 rows=17 loops=1)

  • Hash Cond: (o.id = o_1.id)
5. 0.042 0.042 ↓ 8.5 17 1

Index Scan using user_id_idx_on_order on "order" o (cost=0.42..15.09 rows=2 width=4) (actual time=0.029..0.042 rows=17 loops=1)

  • Index Cond: (userid = 134282)
  • Filter: ((type <> 2) AND (status = ANY ('{3,4,10,20,40}'::integer[])))
6. 0.008 0.717 ↓ 8.5 17 1

Hash (cost=63.64..63.64 rows=2 width=28) (actual time=0.717..0.717 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.099 0.709 ↓ 8.5 17 1

GroupAggregate (cost=63.47..63.62 rows=2 width=28) (actual time=0.591..0.709 rows=17 loops=1)

  • Group Key: o_1.id
8. 0.084 0.610 ↓ 92.5 370 1

Sort (cost=63.47..63.48 rows=4 width=12) (actual time=0.573..0.610 rows=370 loops=1)

  • Sort Key: o_1.id
  • Sort Method: quicksort Memory: 42kB
9. 0.052 0.526 ↓ 92.5 370 1

Nested Loop (cost=0.85..63.43 rows=4 width=12) (actual time=0.037..0.526 rows=370 loops=1)

10. 0.032 0.032 ↓ 8.5 17 1

Index Scan using user_id_idx_on_order on "order" o_1 (cost=0.42..15.09 rows=2 width=4) (actual time=0.014..0.032 rows=17 loops=1)

  • Index Cond: (userid = 134282)
  • Filter: ((type <> 2) AND (status = ANY ('{3,4,10,20,40}'::integer[])))
11. 0.442 0.442 ↓ 4.4 22 17

Index Scan using order_id_idx_on_order_item on orderitem oi (cost=0.43..24.12 rows=5 width=12) (actual time=0.009..0.026 rows=22 loops=17)

  • Index Cond: (orderid = o_1.id)
12. 0.011 141.525 ↓ 8.5 17 1

Hash (cost=143.78..143.78 rows=2 width=36) (actual time=141.525..141.525 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 21.576 141.514 ↓ 8.5 17 1

GroupAggregate (cost=143.47..143.76 rows=2 width=36) (actual time=114.772..141.514 rows=17 loops=1)

  • Group Key: o_2.id
14. 28.539 119.938 ↓ 3,104.0 108,641 1

Sort (cost=143.47..143.56 rows=35 width=10) (actual time=112.815..119.938 rows=108,641 loops=1)

  • Sort Key: o_2.id
  • Sort Method: quicksort Memory: 8165kB
15. 15.276 91.399 ↓ 3,104.0 108,641 1

Nested Loop (cost=1.29..142.57 rows=35 width=10) (actual time=0.050..91.399 rows=108,641 loops=1)

16. 0.079 0.643 ↓ 92.5 370 1

Nested Loop (cost=0.85..63.43 rows=4 width=8) (actual time=0.025..0.643 rows=370 loops=1)

17. 0.054 0.054 ↓ 8.5 17 1

Index Scan using user_id_idx_on_order on "order" o_2 (cost=0.42..15.09 rows=2 width=4) (actual time=0.013..0.054 rows=17 loops=1)

  • Index Cond: (userid = 134282)
  • Filter: ((type <> 2) AND (status = ANY ('{3,4,10,20,40}'::integer[])))
18. 0.510 0.510 ↓ 4.4 22 17

Index Scan using order_id_idx_on_order_item on orderitem oi_1 (cost=0.43..24.12 rows=5 width=8) (actual time=0.009..0.030 rows=22 loops=17)

  • Index Cond: (orderid = o_2.id)
19. 75.480 75.480 ↑ 2.3 294 370

Index Scan using order_item_id_idx_on_order_item_late_fee on orderitemlatefee oilf (cost=0.43..12.95 rows=684 width=10) (actual time=0.025..0.204 rows=294 loops=370)

  • Index Cond: (orderitemid = oi_1.id)
20. 0.000 1.080 ↓ 0.0 0 1

Hash (cost=66.70..66.70 rows=2 width=36) (actual time=1.080..1.080 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
21. 0.001 1.080 ↓ 0.0 0 1

GroupAggregate (cost=66.64..66.68 rows=2 width=36) (actual time=1.080..1.080 rows=0 loops=1)

  • Group Key: o_3.id
22. 0.005 1.079 ↓ 0.0 0 1

Sort (cost=66.64..66.64 rows=3 width=10) (actual time=1.079..1.079 rows=0 loops=1)

  • Sort Key: o_3.id
  • Sort Method: quicksort Memory: 25kB
23. 0.202 1.074 ↓ 0.0 0 1

Nested Loop (cost=1.28..66.61 rows=3 width=10) (actual time=1.074..1.074 rows=0 loops=1)

24. 0.041 0.502 ↓ 92.5 370 1

Nested Loop (cost=0.85..63.43 rows=4 width=8) (actual time=0.062..0.502 rows=370 loops=1)

25. 0.053 0.053 ↓ 8.5 17 1

Index Scan using user_id_idx_on_order on "order" o_3 (cost=0.42..15.09 rows=2 width=4) (actual time=0.037..0.053 rows=17 loops=1)

  • Index Cond: (userid = 134282)
  • Filter: ((type <> 2) AND (status = ANY ('{3,4,10,20,40}'::integer[])))
26. 0.408 0.408 ↓ 4.4 22 17

Index Scan using order_id_idx_on_order_item on orderitem oi_2 (cost=0.43..24.12 rows=5 width=8) (actual time=0.008..0.024 rows=22 loops=17)

  • Index Cond: (orderid = o_3.id)
27. 0.370 0.370 ↓ 0.0 0 370

Index Scan using order_item_id_idx_on_order_item_coupon_discount on orderitemcoupondiscount oicd (cost=0.42..0.67 rows=12 width=10) (actual time=0.001..0.001 rows=0 loops=370)

  • Index Cond: (orderitemid = oi_2.id)
28. 0.003 9.288 ↓ 8.5 17 1

Hash (cost=68.53..68.53 rows=2 width=36) (actual time=9.288..9.288 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
29. 1.329 9.285 ↓ 8.5 17 1

GroupAggregate (cost=68.40..68.51 rows=2 width=36) (actual time=7.592..9.285 rows=17 loops=1)

  • Group Key: o_4.id
30. 1.489 7.956 ↓ 593.2 7,119 1

Sort (cost=68.40..68.43 rows=12 width=9) (actual time=7.460..7.956 rows=7,119 loops=1)

  • Sort Key: o_4.id
  • Sort Method: quicksort Memory: 526kB
31. 0.960 6.467 ↓ 593.2 7,119 1

Nested Loop (cost=1.28..68.18 rows=12 width=9) (actual time=0.055..6.467 rows=7,119 loops=1)

32. 0.055 0.327 ↓ 92.5 370 1

Nested Loop (cost=0.85..63.43 rows=4 width=8) (actual time=0.033..0.327 rows=370 loops=1)

33. 0.034 0.034 ↓ 8.5 17 1

Index Scan using user_id_idx_on_order on "order" o_4 (cost=0.42..15.09 rows=2 width=4) (actual time=0.019..0.034 rows=17 loops=1)

  • Index Cond: (userid = 134282)
  • Filter: ((type <> 2) AND (status = ANY ('{3,4,10,20,40}'::integer[])))
34. 0.238 0.238 ↓ 4.4 22 17

Index Scan using order_id_idx_on_order_item on orderitem oi_3 (cost=0.43..24.12 rows=5 width=8) (actual time=0.005..0.014 rows=22 loops=17)

  • Index Cond: (orderid = o_4.id)
35. 5.180 5.180 ↓ 1.1 19 370

Index Scan using order_item_idx_on_order_item_rent on orderitemrent oir (cost=0.43..1.02 rows=17 width=9) (actual time=0.005..0.014 rows=19 loops=370)

  • Index Cond: (orderitemid = oi_3.id)
Planning time : 2.509 ms
Execution time : 153.590 ms