explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kzTT

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.266 ↑ 1.0 1 1

Nested Loop (cost=716.52..716.83 rows=1 width=320) (actual time=0.264..0.266 rows=1 loops=1)

2.          

CTE partner_aml

3. 0.043 0.167 ↑ 2.1 26 1

Nested Loop (cost=5.27..673.46 rows=55 width=44) (actual time=0.046..0.167 rows=26 loops=1)

4. 0.025 0.046 ↑ 2.1 26 1

Bitmap Heap Scan on account_move_line aml_10 (cost=4.85..217.26 rows=55 width=44) (actual time=0.030..0.046 rows=26 loops=1)

  • Recheck Cond: (partner_id = 7957)
  • Heap Blocks: exact=8
5. 0.021 0.021 ↑ 2.1 26 1

Bitmap Index Scan on account_move_line_partner_id_ref_idx (cost=0.00..4.83 rows=55 width=0) (actual time=0.021..0.021 rows=26 loops=1)

  • Index Cond: (partner_id = 7957)
6. 0.078 0.078 ↑ 1.0 1 26

Index Scan using account_move_pkey on account_move am (cost=0.42..8.29 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=26)

  • Index Cond: (id = aml_10.move_id)
  • Filter: ((state)::text = 'posted'::text)
7.          

CTE writeoff_asset_aml

8. 0.001 0.007 ↓ 0.0 0 1

Nested Loop (cost=0.42..9.68 rows=1 width=120) (actual time=0.006..0.007 rows=0 loops=1)

9. 0.006 0.006 ↓ 0.0 0 1

CTE Scan on partner_aml aml_11 (cost=0.00..1.24 rows=1 width=120) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: (((NOT reconciled) OR (reconciled IS NULL)) AND (account_id = 278))
  • Rows Removed by Filter: 26
10. 0.000 0.000 ↓ 0.0 0

Index Scan using account_move_pkey on account_move am_1 (cost=0.42..8.44 rows=1 width=8) (never executed)

  • Index Cond: (id = aml_11.move_id)
  • Filter: (((NOT is_reversal_move) OR (is_reversal_move IS NULL)) AND (reversal_id IS NULL))
11.          

CTE writeoff_aml

12. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=8.86..16.82 rows=2 width=72) (actual time=0.007..0.007 rows=0 loops=1)

13. 0.007 0.007 ↓ 0.0 0 1

CTE Scan on writeoff_asset_aml aml_12 (cost=0.00..0.02 rows=1 width=80) (actual time=0.007..0.007 rows=0 loops=1)

14. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on account_payment payment (cost=8.86..16.78 rows=2 width=4) (never executed)

  • Recheck Cond: ((aml_12.payment_id = id) OR (aml_12.bord_payment_id = id))
  • Filter: ((state)::text = ANY ('{done,posted}'::text[]))
15. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=8.86..8.86 rows=2 width=0) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on account_payment_pkey (cost=0.00..4.43 rows=1 width=0) (never executed)

  • Index Cond: (aml_12.payment_id = id)
17. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on account_payment_pkey (cost=0.00..4.43 rows=1 width=0) (never executed)

  • Index Cond: (aml_12.bord_payment_id = id)
18.          

CTE asset_aml

19. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on writeoff_asset_aml aml_13 (cost=0.00..0.02 rows=1 width=104) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((move_payment_id IS NULL) AND (journal_id = ANY ('{35,41}'::integer[])))
20. 0.001 0.264 ↑ 1.0 1 1

Nested Loop (cost=16.51..16.79 rows=1 width=288) (actual time=0.261..0.264 rows=1 loops=1)

21. 0.002 0.261 ↑ 1.0 1 1

Nested Loop (cost=16.48..16.72 rows=1 width=256) (actual time=0.259..0.261 rows=1 loops=1)

22. 0.001 0.258 ↑ 1.0 1 1

Nested Loop (cost=16.43..16.64 rows=1 width=224) (actual time=0.256..0.258 rows=1 loops=1)

23. 0.002 0.248 ↑ 1.0 1 1

Nested Loop (cost=16.37..16.55 rows=1 width=192) (actual time=0.247..0.248 rows=1 loops=1)

24. 0.002 0.239 ↑ 1.0 1 1

Nested Loop (cost=6.67..6.83 rows=1 width=160) (actual time=0.238..0.239 rows=1 loops=1)

25. 0.001 0.222 ↑ 1.0 1 1

Nested Loop (cost=5.29..5.41 rows=1 width=128) (actual time=0.221..0.222 rows=1 loops=1)

26. 0.001 0.214 ↑ 1.0 1 1

Nested Loop (cost=3.90..3.99 rows=1 width=96) (actual time=0.214..0.214 rows=1 loops=1)

27. 0.003 0.205 ↑ 1.0 1 1

Nested Loop (cost=2.51..2.57 rows=1 width=64) (actual time=0.204..0.205 rows=1 loops=1)

28. 0.003 0.195 ↑ 1.0 1 1

Aggregate (cost=1.26..1.27 rows=1 width=32) (actual time=0.195..0.195 rows=1 loops=1)

29. 0.192 0.192 ↓ 0.0 0 1

CTE Scan on partner_aml aml (cost=0.00..1.24 rows=2 width=96) (actual time=0.192..0.192 rows=0 loops=1)

  • Filter: (account_id = ANY ('{905,960}'::integer[]))
  • Rows Removed by Filter: 26
30. 0.001 0.007 ↑ 1.0 1 1

Aggregate (cost=1.26..1.27 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=1)

31. 0.006 0.006 ↓ 0.0 0 1

CTE Scan on partner_aml aml_1 (cost=0.00..1.24 rows=2 width=96) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: (account_id = ANY ('{285,323}'::integer[]))
  • Rows Removed by Filter: 26
32. 0.001 0.008 ↑ 1.0 1 1

Aggregate (cost=1.39..1.40 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=1)

33. 0.007 0.007 ↓ 0.0 0 1

CTE Scan on partner_aml aml_2 (cost=0.00..1.38 rows=1 width=96) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (((NOT reconciled) OR (reconciled IS NULL)) AND (mbu_payment_id IS NULL) AND (journal_id <> 42) AND (account_id = 897))
  • Rows Removed by Filter: 26
34. 0.001 0.007 ↑ 1.0 1 1

Aggregate (cost=1.39..1.40 rows=1 width=32) (actual time=0.006..0.007 rows=1 loops=1)

35. 0.006 0.006 ↓ 0.0 0 1

CTE Scan on partner_aml aml_3 (cost=0.00..1.38 rows=1 width=96) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: ((NOT reconciled) AND (journal_id <> 35) AND (account_id = 278))
  • Rows Removed by Filter: 26
36. 0.009 0.015 ↑ 1.0 1 1

Aggregate (cost=1.38..1.40 rows=1 width=32) (actual time=0.015..0.015 rows=1 loops=1)

37. 0.006 0.006 ↓ 4.0 4 1

CTE Scan on partner_aml aml_4 (cost=0.00..1.38 rows=1 width=64) (actual time=0.002..0.006 rows=4 loops=1)

  • Filter: (reconciled AND (account_id = 278) AND (journal_id = 35))
  • Rows Removed by Filter: 22
38. 0.001 0.007 ↑ 1.0 1 1

Aggregate (cost=9.70..9.71 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=1)

39. 0.000 0.006 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.42..9.69 rows=1 width=64) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: ((aml_5.payment_id IS NULL) OR (((NOT p.is_mbu_payment) OR (p.is_mbu_payment IS NULL)) AND (NOT p.is_b2b2c_blue_payment)))
40. 0.006 0.006 ↓ 0.0 0 1

CTE Scan on partner_aml aml_5 (cost=0.00..1.24 rows=1 width=68) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: (((NOT reconciled) OR (reconciled IS NULL)) AND (account_id = 400))
  • Rows Removed by Filter: 26
41. 0.000 0.000 ↓ 0.0 0

Index Scan using account_payment_pkey on account_payment p (cost=0.42..8.44 rows=1 width=6) (never executed)

  • Index Cond: (aml_5.payment_id = id)
42. 0.002 0.009 ↑ 1.0 1 1

Aggregate (cost=0.06..0.07 rows=1 width=32) (actual time=0.008..0.009 rows=1 loops=1)

43. 0.007 0.007 ↓ 0.0 0 1

CTE Scan on writeoff_aml aml_6 (cost=0.00..0.04 rows=2 width=64) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (order_id IS NOT NULL)
44. 0.001 0.001 ↑ 1.0 1 1

Aggregate (cost=0.05..0.06 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

45. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on writeoff_aml aml_7 (cost=0.00..0.04 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (order_id IS NULL)
46. 0.001 0.002 ↑ 1.0 1 1

Aggregate (cost=0.03..0.05 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1)

47. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on asset_aml aml_8 (cost=0.00..0.02 rows=1 width=96) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (order_id IS NOT NULL)
48. 0.001 0.001 ↑ 1.0 1 1

Aggregate (cost=0.03..0.05 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

49. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on asset_aml aml_9 (cost=0.00..0.02 rows=1 width=96) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (order_id IS NULL)
Planning time : 8.831 ms
Execution time : 0.606 ms