explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FENJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.020 ↓ 0.0 0 1

Limit (cost=68.19..162.37 rows=1 width=189) (actual time=0.019..0.020 rows=0 loops=1)

2. 0.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=68.19..162.37 rows=1 width=189) (actual time=0.018..0.018 rows=0 loops=1)

  • Join Filter: (ap.ap_payment_type_id = apt.id)
3. 0.001 0.017 ↓ 0.0 0 1

Nested Loop (cost=68.19..160.77 rows=1 width=146) (actual time=0.017..0.017 rows=0 loops=1)

  • Join Filter: (ah.ap_payee_location_id = apl.id)
4. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=67.77..154.57 rows=1 width=147) (actual time=0.016..0.016 rows=0 loops=1)

5. 0.001 0.016 ↓ 0.0 0 1

Nested Loop Left Join (cost=44.10..111.57 rows=1 width=111) (actual time=0.015..0.016 rows=0 loops=1)

6. 0.001 0.015 ↓ 0.0 0 1

Nested Loop (cost=1.96..37.39 rows=1 width=107) (actual time=0.014..0.015 rows=0 loops=1)

7. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=1.54..26.95 rows=1 width=107) (actual time=0.014..0.014 rows=0 loops=1)

  • Join Filter: (ap.bank_account_id = ba.id)
8. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=1.26..20.89 rows=1 width=79) (actual time=0.013..0.013 rows=0 loops=1)

  • Join Filter: ((max(LEAST(ah_1.id, ah_1.reversal_ap_header_id))) = ah.id)
9. 0.012 0.012 ↓ 0.0 0 1

Index Scan using idx_ap_headers_cid_id_post_month on ap_headers ah (cost=0.42..6.19 rows=1 width=25) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (cid = 8839)
  • Filter: ((deleted_on IS NULL) AND (NOT is_initial_import))
10. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..14.69 rows=1 width=58) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_payments_remote_primary_key on ap_payments ap (cost=0.42..6.20 rows=1 width=54) (never executed)

  • Index Cond: (cid = 8839)
  • Filter: ((NOT is_unclaimed_property) AND (ap_payment_type_id = ANY ('{1,2,3,4,5,6,7,8,9,10,11,14}'::integer[])))
12. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=0.42..8.47 rows=1 width=12) (never executed)

  • Group Key: ah_1.cid, ah_1.ap_payment_id
13. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_headers_ap_payment_id_partial on ap_headers ah_1 (cost=0.42..8.45 rows=1 width=16) (never executed)

  • Index Cond: (ap_payment_id = ap.id)
  • Filter: ((deleted_on IS NULL) AND (cid = ap.cid) AND (ap_header_type_id = 5) AND (gl_transaction_type_id = 3))
14. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_bank_accounts on bank_accounts ba (cost=0.28..6.04 rows=1 width=36) (never executed)

  • Index Cond: (cid = 8839)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_ap_remittances on ap_remittances ar (cost=0.42..8.44 rows=1 width=12) (never executed)

  • Index Cond: ((cid = 8839) AND (id = ah.ap_remittance_id))
16. 0.000 0.000 ↓ 0.0 0

Limit (cost=42.14..74.15 rows=1 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Result (cost=42.14..74.15 rows=1 width=8) (never executed)

  • One-Time Filter: (ah.cid = 8839)
18. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=42.14..74.15 rows=1 width=8) (never executed)

  • Join Filter: (aa.cid = gr.cid)
19. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=41.85..70.68 rows=1 width=20) (never executed)

  • Join Filter: ((aa.cid = gd.cid) AND (CASE WHEN ((aa.origin_ap_allocation_id IS NOT NULL) OR (aa.lump_ap_header_id IS NOT NULL)) THEN (aa.allocation_amount * '-1'::numeric) ELSE aa.allocation_amount END = gd.amount) AND (CASE WHEN (ba.reimbursed_property_id <> aa.property_id) THEN ba.reimbursed_property_id ELSE aa.property_id END = gd.property_id))
20. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=41.28..57.72 rows=1 width=34) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=40.72..51.51 rows=1 width=34) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=40.30..43.06 rows=1 width=8) (never executed)

  • Hash Cond: (load_properties_info.property_id = ad.property_id)
23. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=16.62..18.62 rows=200 width=4) (never executed)

  • Group Key: load_properties_info.property_id
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on load_properties_info (cost=0.00..15.30 rows=530 width=4) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.66..23.66 rows=1 width=12) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_details_ap_header_id on ap_details ad (cost=0.42..23.66 rows=1 width=12) (never executed)

  • Index Cond: (ah.id = ap_header_id)
  • Filter: ((deleted_on IS NULL) AND (ah.gl_transaction_type_id = gl_transaction_type_id) AND (ah.post_month = post_month))
27. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_allocations_credit_ap_detail_id on ap_allocations aa (cost=0.42..8.45 rows=1 width=34) (never executed)

  • Index Cond: (credit_ap_detail_id = ad.id)
  • Filter: ((gl_transaction_type_id = 4) AND (ad.cid = cid))
28. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_headers_cid_reference_id on gl_headers gh (cost=0.56..6.20 rows=1 width=16) (never executed)

  • Index Cond: ((cid = aa.cid) AND (reference_id = aa.id))
  • Filter: (gl_transaction_type_id = 4)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_details_gl_header_id on gl_details gd (cost=0.57..12.93 rows=1 width=21) (never executed)

  • Index Cond: (gl_header_id = gh.id)
  • Filter: ((gl_reconciliation_id IS NOT NULL) AND (gh.cid = cid))
30. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_gl_reconciliations on gl_reconciliations gr (cost=0.28..3.46 rows=1 width=12) (never executed)

  • Index Cond: ((cid = gd.cid) AND (id = gd.gl_reconciliation_id))
31. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=23.68..42.98 rows=1 width=48) (never executed)

  • Group Key: (ah.cid), (ah.id)
32. 0.000 0.000 ↓ 0.0 0

Result (cost=23.68..42.96 rows=1 width=130) (never executed)

  • One-Time Filter: (ah.cid = 8839)
33. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=23.68..42.96 rows=1 width=130) (never executed)

  • Hash Cond: ((lp.cid = ad_1.cid) AND (lp.property_id = ad_1.property_id))
34. 0.000 0.000 ↓ 0.0 0

Seq Scan on load_properties_info lp (cost=0.00..15.30 rows=530 width=126) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.66..23.66 rows=1 width=8) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_details_ap_header_id on ap_details ad_1 (cost=0.42..23.66 rows=1 width=8) (never executed)

  • Index Cond: (ah.id = ap_header_id)
  • Filter: ((deleted_on IS NULL) AND (ah.gl_transaction_type_id = gl_transaction_type_id) AND (ah.post_month = post_month))
37. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_ap_payee_locations on ap_payee_locations apl (cost=0.42..6.19 rows=1 width=15) (never executed)

  • Index Cond: (cid = 8839)
38. 0.000 0.000 ↓ 0.0 0

Seq Scan on ap_payment_types apt (cost=0.00..1.14 rows=14 width=15) (never executed)

Planning time : 19.146 ms