explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3UIY

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.270 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.09..69.14 rows=2 width=990) (actual time=0.187..0.270 rows=2 loops=1)

2.          

Initplan (for Nested Loop Left Join)

3. 0.004 0.036 ↑ 1.0 1 1

Result (cost=5.91..9.93 rows=1 width=8) (actual time=0.035..0.036 rows=1 loops=1)

  • One-Time Filter: (($0)::text <> 'ABORTED'::text)
4.          

Initplan (for Result)

5. 0.001 0.010 ↑ 2.0 1 1

Unique (cost=0.56..5.48 rows=2 width=37) (actual time=0.008..0.010 rows=1 loops=1)

6. 0.009 0.009 ↑ 1.0 2 1

Index Scan Backward using pk_fulfillment_order_state on fulfillment_order_state fulfillment_order_state_1 (cost=0.56..5.48 rows=2 width=37) (actual time=0.007..0.009 rows=2 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
7. 0.022 0.022 ↑ 1.0 1 1

Index Scan using ix_original_fulfillment_order_id on fulfillment_order (cost=5.91..9.93 rows=1 width=8) (actual time=0.021..0.022 rows=1 loops=1)

  • Index Cond: (original_fulfillment_order_id = 4664339)
8. 0.003 0.229 ↑ 1.0 2 1

Nested Loop Left Join (cost=19.01..58.69 rows=2 width=909) (actual time=0.148..0.229 rows=2 loops=1)

9. 0.000 0.226 ↓ 2.0 2 1

Nested Loop Left Join (cost=18.58..54.18 rows=1 width=841) (actual time=0.147..0.226 rows=2 loops=1)

  • Join Filter: (plor.fulfillment_order_id = o.fulfillment_order_id)
10. 0.008 0.212 ↓ 2.0 2 1

Nested Loop Left Join (cost=18.15..49.73 rows=1 width=558) (actual time=0.139..0.212 rows=2 loops=1)

11. 0.004 0.204 ↓ 2.0 2 1

Nested Loop Left Join (cost=17.87..45.41 rows=1 width=566) (actual time=0.135..0.204 rows=2 loops=1)

  • Join Filter: ((c.fulfillment_order_id = cb.fulfillment_order_id) AND (c.code = cb.code))
12. 0.002 0.134 ↓ 2.0 2 1

Nested Loop Left Join (cost=17.87..38.62 rows=1 width=566) (actual time=0.104..0.134 rows=2 loops=1)

  • Join Filter: ((o.fulfillment_order_id = cv.fulfillment_order_id) AND (cv.code = c.code))
13. 0.002 0.122 ↓ 2.0 2 1

Nested Loop Left Join (cost=13.41..34.12 rows=1 width=558) (actual time=0.093..0.122 rows=2 loops=1)

  • Join Filter: (o.fulfillment_order_id = c.fulfillment_order_id)
14. 0.004 0.108 ↓ 2.0 2 1

Nested Loop Left Join (cost=8.96..29.61 rows=1 width=526) (actual time=0.081..0.108 rows=2 loops=1)

  • Join Filter: (o.fulfillment_order_id = p.fulfillment_order_id)
15. 0.013 0.100 ↓ 2.0 2 1

Nested Loop Left Join (cost=8.81..25.44 rows=1 width=518) (actual time=0.077..0.100 rows=2 loops=1)

  • Join Filter: (o.fulfillment_order_id = g.fulfillment_order_id)
16. 0.001 0.077 ↓ 2.0 2 1

Nested Loop Left Join (cost=6.64..18.83 rows=1 width=418) (actual time=0.067..0.077 rows=2 loops=1)

  • Join Filter: (o.fulfillment_order_id = a.fulfillment_order_id)
17. 0.003 0.065 ↑ 1.0 1 1

Nested Loop (cost=6.21..14.34 rows=1 width=360) (actual time=0.058..0.065 rows=1 loops=1)

18. 0.003 0.026 ↑ 1.0 1 1

Nested Loop (cost=0.72..8.76 rows=1 width=347) (actual time=0.025..0.026 rows=1 loops=1)

19. 0.015 0.015 ↑ 1.0 1 1

Index Scan using pk_fulfillment_order on fulfillment_order o (cost=0.43..4.45 rows=1 width=294) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
20. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pk_session on session s (cost=0.29..4.30 rows=1 width=69) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: ((period_number = o.period_number) AND (session_number = o.session_number))
21. 0.003 0.036 ↑ 1.0 1 1

Subquery Scan on lastorderstate (cost=5.49..5.56 rows=1 width=21) (actual time=0.031..0.036 rows=1 loops=1)

  • Filter: (((lastorderstate.state)::text <> 'ABORTED'::text) AND (lastorderstate.rank = 1))
  • Rows Removed by Filter: 1
22. 0.007 0.033 ↑ 1.0 2 1

WindowAgg (cost=5.49..5.53 rows=2 width=77) (actual time=0.029..0.033 rows=2 loops=1)

23. 0.013 0.026 ↑ 1.0 2 1

Sort (cost=5.49..5.50 rows=2 width=53) (actual time=0.025..0.026 rows=2 loops=1)

  • Sort Key: (ROW(fulfillment_order_state.period_number, fulfillment_order_state.session_number)) DESC
  • Sort Method: quicksort Memory: 25kB
24. 0.013 0.013 ↑ 1.0 2 1

Index Scan using pk_fulfillment_order_state on fulfillment_order_state (cost=0.56..5.48 rows=2 width=53) (actual time=0.011..0.013 rows=2 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
25. 0.011 0.011 ↑ 1.0 2 1

Index Scan using fulfillment_order_award_stephan on fulfillment_order_award a (cost=0.43..4.47 rows=2 width=66) (actual time=0.009..0.011 rows=2 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
26. 0.002 0.010 ↓ 0.0 0 2

Bitmap Heap Scan on fulfillment_order_gift g (cost=2.17..6.57 rows=3 width=108) (actual time=0.005..0.005 rows=0 loops=2)

  • Recheck Cond: (fulfillment_order_id = 4664339)
27. 0.008 0.008 ↓ 0.0 0 2

Bitmap Index Scan on pk_fulfillment_order_gift (cost=0.00..2.17 rows=3 width=0) (actual time=0.004..0.004 rows=0 loops=2)

  • Index Cond: (fulfillment_order_id = 4664339)
28. 0.004 0.004 ↓ 0.0 0 2

Index Scan using uc_fulfillment_order_id on fulfillment_order_payoutdate p (cost=0.14..4.16 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=2)

  • Index Cond: (fulfillment_order_id = 4664339)
29. 0.000 0.012 ↓ 0.0 0 2

Subquery Scan on c (cost=4.46..4.49 rows=1 width=32) (actual time=0.006..0.006 rows=0 loops=2)

  • Filter: (c.rank = 1)
30. 0.000 0.012 ↓ 0.0 0 2

WindowAgg (cost=4.46..4.48 rows=1 width=40) (actual time=0.006..0.006 rows=0 loops=2)

31. 0.006 0.012 ↓ 0.0 0 2

Sort (cost=4.46..4.46 rows=1 width=32) (actual time=0.006..0.006 rows=0 loops=2)

  • Sort Key: fulfillment_order_claimcode.period_number, fulfillment_order_claimcode.session_number DESC
  • Sort Method: quicksort Memory: 25kB
32. 0.006 0.006 ↓ 0.0 0 1

Index Scan using pk_fulfillment_order_claimcode on fulfillment_order_claimcode (cost=0.43..4.45 rows=1 width=32) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
33. 0.000 0.010 ↓ 0.0 0 2

Subquery Scan on cv (cost=4.46..4.49 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=2)

  • Filter: (cv.rank = 1)
34. 0.000 0.010 ↓ 0.0 0 2

WindowAgg (cost=4.46..4.48 rows=1 width=80) (actual time=0.005..0.005 rows=0 loops=2)

35. 0.003 0.010 ↓ 0.0 0 2

Sort (cost=4.46..4.46 rows=1 width=56) (actual time=0.005..0.005 rows=0 loops=2)

  • Sort Key: fulfillment_order_claimcode_validity.code, (ROW(fulfillment_order_claimcode_validity.period_number, fulfillment_order_claimcode_validity.session_number)) DESC
  • Sort Method: quicksort Memory: 25kB
36. 0.007 0.007 ↓ 0.0 0 1

Index Scan using pk_claimcode_validity on fulfillment_order_claimcode_validity (cost=0.43..4.45 rows=1 width=56) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (fulfillment_order_id = 4664339)
37. 0.066 0.066 ↓ 0.0 0 2

Seq Scan on fulfillment_order_claimcode_blocked cb (cost=0.00..6.78 rows=1 width=16) (actual time=0.033..0.033 rows=0 loops=2)

  • Filter: (fulfillment_order_id = 4664339)
  • Rows Removed by Filter: 302
38. 0.000 0.000 ↓ 0.0 0 2

Index Scan using pk_session on session se (cost=0.29..4.30 rows=1 width=24) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: ((period_number = c.period_number) AND (session_number = c.session_number))
39. 0.014 0.014 ↓ 0.0 0 2

Index Scan using placed_order_idx on placed_order plor (cost=0.42..4.44 rows=1 width=283) (actual time=0.007..0.007 rows=0 loops=2)

  • Index Cond: (fulfillment_order_id = 4664339)
40. 0.000 0.000 ↓ 0.0 0 2

Index Scan using placed_order_item_idx on placed_order_item plit (cost=0.43..4.48 rows=3 width=76) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (placed_order_id = plor.id)
41. 0.002 0.002 ↓ 0.0 0 2

Index Scan using placed_order_item_additional_info_idx on placed_order_item_additional_info plai (cost=0.15..0.22 rows=4 width=80) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (placed_order_item_id = plit.id)
Planning time : 2.676 ms
Execution time : 0.614 ms