explain.depesz.com

PostgreSQL's explain analyze made readable

Result: foQm

Settings
# exclusive inclusive rows x rows loops node
1. 0.125 71,765.555 ↓ 5.5 11 1

Sort (cost=865.37..865.37 rows=2 width=866) (actual time=71,765.554..71,765.555 rows=11 loops=1)

  • Sort Key: bank_register.property_name, bank_register.bank_account, bank_register.rank, bank_register.transaction_date, bank_register.reference
  • Sort Method: quicksort Memory: 29kB
2. 0.029 71,765.430 ↓ 5.5 11 1

Nested Loop Left Join (cost=865.07..865.36 rows=2 width=866) (actual time=71,765.339..71,765.430 rows=11 loops=1)

  • Join Filter: ((bank_register.cid = ba_4.cid) AND (bank_register.bank_account_id = ba_4.id))
  • Rows Removed by Join Filter: 33
3. 0.007 71,738.616 ↓ 5.5 11 1

Subquery Scan on bank_register (cost=829.49..829.70 rows=2 width=708) (actual time=71,738.572..71,738.616 rows=11 loops=1)

  • Filter: ((bank_register.demo_row = 1) OR (bank_register.rank = 1))
4. 0.043 71,738.609 ↓ 2.8 11 1

WindowAgg (cost=829.49..829.64 rows=4 width=708) (actual time=71,738.571..71,738.609 rows=11 loops=1)

5. 0.048 71,738.566 ↓ 2.8 11 1

Sort (cost=829.49..829.50 rows=4 width=696) (actual time=71,738.563..71,738.566 rows=11 loops=1)

  • Sort Key: bank_register_data.property_id, bank_register_data.bank_account_id, bank_register_data.payment_number, bank_register_data.reference, bank_register_data.memo, bank_register_data.deposit_number, bank_register_data.deposit_id, bank_register_data.header_id, bank_register_data.allocation_datetime DESC
  • Sort Method: quicksort Memory: 28kB
6. 0.060 71,738.518 ↓ 2.8 11 1

GroupAggregate (cost=829.07..829.45 rows=4 width=696) (actual time=71,738.467..71,738.518 rows=11 loops=1)

  • Group Key: bank_register_data.bank_account, bank_register_data.property_id, bank_register_data.property_name, bank_register_data.bank_account_id, bank_register_data.rank, bank_register_data.transaction_date, bank_register_data.post_date, bank_register_data.post_month, bank_register_data.reference, bank_register_data.transaction_type, bank_register_data.memo, bank_register_data.time_zone, bank_register_data.created_by, bank_register_data.created_on, bank_register_data.status, bank_register_data.deposit_number, bank_register_data.header_number, bank_register_data.header_number_ref, bank_register_data.payment_number_ref, bank_register_data.ap_payment_type_id, bank_register_data.payment_type, bank_register_data.deposit_id, bank_register_data.header_id, bank_register_data.payment_number, bank_register_data.allocation_datetime, bank_register_data.gl_reconciliation_status_type_id, bank_register_data.cid
7. 0.180 71,738.458 ↓ 4.2 17 1

Sort (cost=829.07..829.08 rows=4 width=696) (actual time=71,738.455..71,738.458 rows=17 loops=1)

  • Sort Key: bank_register_data.bank_account, bank_register_data.property_id, bank_register_data.property_name, bank_register_data.bank_account_id, bank_register_data.rank, bank_register_data.transaction_date, bank_register_data.post_date, bank_register_data.post_month, bank_register_data.reference, bank_register_data.transaction_type, bank_register_data.memo, bank_register_data.time_zone, bank_register_data.created_by, bank_register_data.created_on, bank_register_data.status, bank_register_data.deposit_number, bank_register_data.header_number, bank_register_data.header_number_ref, bank_register_data.payment_number_ref, bank_register_data.ap_payment_type_id, bank_register_data.payment_type, bank_register_data.deposit_id, bank_register_data.header_id, bank_register_data.payment_number, bank_register_data.allocation_datetime, bank_register_data.gl_reconciliation_status_type_id, bank_register_data.cid
  • Sort Method: quicksort Memory: 32kB
8. 0.018 71,738.278 ↓ 4.2 17 1

Subquery Scan on bank_register_data (cost=274.65..829.03 rows=4 width=696) (actual time=40,707.110..71,738.278 rows=17 loops=1)

9. 0.014 71,738.260 ↓ 4.2 17 1

Append (cost=274.65..828.99 rows=4 width=728) (actual time=40,707.109..71,738.260 rows=17 loops=1)

10. 0.009 40,711.627 ↓ 4.0 4 1

Subquery Scan on "*SELECT* 1" (cost=274.65..274.71 rows=1 width=728) (actual time=40,707.108..40,711.627 rows=4 loops=1)

11. 17.256 40,711.618 ↓ 4.0 4 1

GroupAggregate (cost=274.65..274.69 rows=1 width=944) (actual time=40,707.103..40,711.618 rows=4 loops=1)

  • Group Key: gd.property_id, p.property_name, ba.id, ba.account_name, gat.gl_account_id, gt.account_number_pattern, gt.account_number_delimiter, gat.formatted_account_number, gat.name, gd.cid
12. 48.554 40,694.362 ↓ 20,650.0 20,650 1

Sort (cost=274.65..274.65 rows=1 width=525) (actual time=40,691.309..40,694.362 rows=20,650 loops=1)

  • Sort Key: gd.property_id, p.property_name, ba.id, ba.account_name, gat.gl_account_id, gt.account_number_pattern, gt.account_number_delimiter, gat.formatted_account_number, gat.name
  • Sort Method: quicksort Memory: 6070kB
13. 458.315 40,645.808 ↓ 20,650.0 20,650 1

Nested Loop (cost=3.22..274.64 rows=1 width=525) (actual time=20,365.956..40,645.808 rows=20,650 loops=1)

  • Join Filter: (ga.id = ac.item_gl_account_id)
  • Rows Removed by Join Filter: 532482
14. 420.543 37,974.965 ↓ 553,132.0 553,132 1

Nested Loop (cost=2.93..266.31 rows=1 width=541) (actual time=253.289..37,974.965 rows=553,132 loops=1)

15. 878.288 34,745.922 ↓ 561,700.0 561,700 1

Nested Loop (cost=2.49..265.33 rows=1 width=545) (actual time=253.259..34,745.922 rows=561,700 loops=1)

16. 1,039.507 31,334.782 ↓ 844,284.0 844,284 1

Nested Loop (cost=2.21..265.02 rows=1 width=545) (actual time=253.229..31,334.782 rows=844,284 loops=1)

17. 660.705 27,762.423 ↓ 844,284.0 844,284 1

Nested Loop (cost=1.93..252.71 rows=1 width=427) (actual time=253.209..27,762.423 rows=844,284 loops=1)

  • Join Filter: (lp.property_id = pba.property_id)
18. 302.387 25,413.150 ↓ 211,071.0 211,071 1

Nested Loop (cost=1.66..252.40 rows=1 width=427) (actual time=253.159..25,413.150 rows=211,071 loops=1)

  • Join Filter: (lp.property_id = p.id)
19. 87.640 24,477.550 ↓ 211,071.0 211,071 1

Nested Loop (cost=1.38..252.09 rows=1 width=301) (actual time=253.096..24,477.550 rows=211,071 loops=1)

20. 23.448 23.448 ↑ 1.0 1 1

Function Scan on load_properties lp (cost=0.25..1.00 rows=1 width=4) (actual time=23.447..23.448 rows=1 loops=1)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
21. 158.232 24,366.462 ↓ 52,767.8 211,071 1

Nested Loop (cost=1.13..251.05 rows=4 width=297) (actual time=229.645..24,366.462 rows=211,071 loops=1)

22. 2.172 8.418 ↓ 1,162.0 1,162 1

Nested Loop (cost=0.56..16.62 rows=1 width=276) (actual time=0.040..8.418 rows=1,162 loops=1)

23. 0.024 0.024 ↑ 1.0 1 1

Index Scan using idx_gl_trees_cid_is_system on gl_trees gt (cost=0.14..8.16 rows=1 width=244) (actual time=0.010..0.024 rows=1 loops=1)

  • Index Cond: (cid = 224)
  • Filter: ((system_code)::text = 'DEFAULT'::text)
24. 6.222 6.222 ↓ 1,162.0 1,162 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat (cost=0.42..8.44 rows=1 width=44) (actual time=0.027..6.222 rows=1,162 loops=1)

  • Index Cond: ((cid = 224) AND (gl_tree_id = gt.id))
25. 24,199.812 24,199.812 ↓ 45.5 182 1,162

Index Scan using idx_gl_details_cid_property_id_post_month_cash_gl_account_id on gl_details gd (cost=0.56..234.40 rows=4 width=21) (actual time=17.823..20.826 rows=182 loops=1,162)

  • Index Cond: ((cid = 224) AND (property_id = lp.property_id) AND (cash_gl_account_id = gat.gl_account_id))
26. 633.213 633.213 ↑ 1.0 1 211,071

Index Scan using pk_properties on properties p (cost=0.28..0.30 rows=1 width=126) (actual time=0.003..0.003 rows=1 loops=211,071)

  • Index Cond: ((cid = 224) AND (id = gd.property_id))
27. 1,688.568 1,688.568 ↓ 4.0 4 211,071

Index Scan using idx_property_bank_accounts_cid_prop_bank on property_bank_accounts pba (cost=0.28..0.30 rows=1 width=16) (actual time=0.004..0.008 rows=4 loops=211,071)

  • Index Cond: ((cid = 224) AND (property_id = gd.property_id))
  • Filter: (bank_account_id = ANY ('{5986,5987,148,4109}'::integer[]))
  • Rows Removed by Filter: 1
28. 2,532.852 2,532.852 ↑ 1.0 1 844,284

Index Scan using pk_bank_accounts on bank_accounts ba (cost=0.28..8.29 rows=1 width=126) (actual time=0.003..0.003 rows=1 loops=844,284)

  • Index Cond: ((cid = 224) AND (id = pba.bank_account_id))
29. 2,532.852 2,532.852 ↑ 1.0 1 844,284

Index Scan using idx_gl_accounts_id on gl_accounts ga (cost=0.29..0.31 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=844,284)

  • Index Cond: (id = gd.cash_gl_account_id)
  • Filter: ((cid = 224) AND (gl_group_type_id = ANY ('{1,2,3}'::integer[])))
  • Rows Removed by Filter: 0
30. 2,808.500 2,808.500 ↑ 1.0 1 561,700

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..0.98 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=561,700)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((NOT is_template) AND (post_month < '2019-08-01'::date) AND (cid = 224) AND (gl_book_id = 132) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])) AND (gl_transaction_type_id = ANY ('{1,2,3,4,5,7,8,13,14,15,16}'::integer[])))
  • Rows Removed by Filter: 0
31. 2,212.528 2,212.528 ↑ 1.0 1 553,132

Index Scan using pk_ap_codes on ap_codes ac (cost=0.29..8.31 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=553,132)

  • Index Cond: ((cid = 224) AND (id = pba.bank_ap_code_id))
  • Filter: ((ap_code_type_id = 1) AND (item_gl_account_id = ANY ('{160690,160486,305002,304892}'::integer[])))
32. 0.000 0.048 ↓ 0.0 0 1

Subquery Scan on "*SELECT* 2" (cost=6.76..167.43 rows=1 width=895) (actual time=0.048..0.048 rows=0 loops=1)

33. 0.001 0.048 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.76..167.41 rows=1 width=867) (actual time=0.047..0.048 rows=0 loops=1)

  • Join Filter: (tz.id = p_1.time_zone_id)
34. 0.000 0.047 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.76..164.75 rows=1 width=1,329) (actual time=0.047..0.047 rows=0 loops=1)

35. 0.001 0.047 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.48..164.38 rows=1 width=1,101) (actual time=0.046..0.047 rows=0 loops=1)

36. 0.000 0.046 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.05..163.91 rows=1 width=1,097) (actual time=0.046..0.046 rows=0 loops=1)

37. 0.001 0.046 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.63..163.30 rows=1 width=1,049) (actual time=0.045..0.046 rows=0 loops=1)

38. 0.000 0.045 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.21..162.68 rows=1 width=1,057) (actual time=0.045..0.045 rows=0 loops=1)

39. 0.001 0.045 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.78..154.22 rows=1 width=1,049) (actual time=0.045..0.045 rows=0 loops=1)

  • Join Filter: ((aa.cid = gh_1.cid) AND (aa.gl_transaction_type_id = gh_1.gl_transaction_type_id) AND (aa.id = gh_1.reference_id))
40. 0.000 0.044 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.36..145.76 rows=1 width=1,045) (actual time=0.044..0.044 rows=0 loops=1)

  • Join Filter: ((ard.cid = gh_1.cid) AND (ard.gl_transaction_type_id = gh_1.gl_transaction_type_id) AND (ard.id = gh_1.reference_id))
41. 0.001 0.044 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.94..137.30 rows=1 width=1,037) (actual time=0.044..0.044 rows=0 loops=1)

  • Join Filter: (grst.id = gr.gl_reconciliation_status_type_id)
42. 0.000 0.043 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.94..136.21 rows=1 width=915) (actual time=0.043..0.043 rows=0 loops=1)

43. 0.001 0.043 ↓ 0.0 0 1

Nested Loop (cost=3.65..135.90 rows=1 width=915) (actual time=0.043..0.043 rows=0 loops=1)

44. 0.000 0.042 ↓ 0.0 0 1

Nested Loop (cost=3.38..123.60 rows=1 width=801) (actual time=0.042..0.042 rows=0 loops=1)

  • Join Filter: (ga_1.id = ac_1.item_gl_account_id)
45. 0.001 0.042 ↓ 0.0 0 1

Nested Loop (cost=3.09..115.27 rows=1 width=817) (actual time=0.042..0.042 rows=0 loops=1)

  • Join Filter: (lp_1.property_id = pba_1.property_id)
46. 0.000 0.041 ↓ 0.0 0 1

Nested Loop (cost=2.82..114.96 rows=1 width=821) (actual time=0.041..0.041 rows=0 loops=1)

  • Join Filter: (lp_1.property_id = p_1.id)
47. 0.001 0.041 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.54..114.65 rows=1 width=691) (actual time=0.040..0.041 rows=0 loops=1)

  • Join Filter: (gtt.id = gh_1.gl_transaction_type_id)
48. 0.000 0.040 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.54..109.30 rows=1 width=193) (actual time=0.040..0.040 rows=0 loops=1)

  • Join Filter: (gh_1.is_reverse IS FALSE)
49. 0.001 0.040 ↓ 0.0 0 1

Nested Loop (cost=2.10..100.83 rows=1 width=190) (actual time=0.039..0.040 rows=0 loops=1)

50. 0.000 0.039 ↓ 0.0 0 1

Nested Loop (cost=1.83..99.97 rows=1 width=198) (actual time=0.039..0.039 rows=0 loops=1)

51. 0.001 0.039 ↓ 0.0 0 1

Nested Loop (cost=1.54..99.66 rows=1 width=190) (actual time=0.038..0.039 rows=0 loops=1)

52. 0.000 0.038 ↓ 0.0 0 1

Nested Loop (cost=1.12..98.41 rows=1 width=178) (actual time=0.038..0.038 rows=0 loops=1)

  • Join Filter: (gd_1.property_id = lp_1.property_id)
53. 0.001 0.038 ↓ 0.0 0 1

Nested Loop (cost=0.87..97.39 rows=1 width=174) (actual time=0.037..0.038 rows=0 loops=1)

54. 0.037 0.037 ↓ 0.0 0 1

Index Scan using idx_gl_headers_cid_gl_transaction_type_id_post_month_reference_ on gl_headers gh_1 (cost=0.43..72.49 rows=2 width=102) (actual time=0.036..0.037 rows=0 loops=1)

  • Index Cond: ((cid = 224) AND (gl_transaction_type_id = 1) AND (post_month >= '2019-08-01'::date) AND (post_month <= '2019-08-01'::date))
  • Filter: ((NOT is_template) AND (gl_book_id = 132) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
55. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_details_cid_gl_header_id on gl_details gd_1 (cost=0.44..12.43 rows=2 width=76) (never executed)

  • Index Cond: ((cid = 224) AND (gl_header_id = gh_1.id))
56. 0.000 0.000 ↓ 0.0 0

Function Scan on load_properties lp_1 (cost=0.25..1.00 rows=1 width=4) (never executed)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
57. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_account_trees_gl_account_id on gl_account_trees gat_1 (cost=0.42..1.24 rows=1 width=12) (never executed)

  • Index Cond: (gl_account_id = gd_1.cash_gl_account_id)
  • Filter: (cid = 224)
58. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_accounts_id on gl_accounts ga_1 (cost=0.29..0.31 rows=1 width=8) (never executed)

  • Index Cond: (id = gd_1.cash_gl_account_id)
  • Filter: (cid = 224)
59. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_gl_trees on gl_trees gt_1 (cost=0.27..0.57 rows=1 width=8) (never executed)

  • Index Cond: ((cid = 224) AND (id = gat_1.gl_tree_id))
  • Filter: (((system_code)::text = 'DEFAULT'::text) AND (is_system = 1))
60. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_gl_details_cid_offsetting_gl_header_id on gl_headers gh1 (cost=0.43..8.46 rows=1 width=12) (never executed)

  • Index Cond: ((gh_1.cid = cid) AND (cid = 224) AND (gh_1.id = offsetting_gl_header_id))
61. 0.000 0.000 ↓ 0.0 0

Seq Scan on gl_transaction_types gtt (cost=0.00..5.34 rows=1 width=502) (never executed)

  • Filter: (id = 1)
62. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_properties on properties p_1 (cost=0.28..0.30 rows=1 width=130) (never executed)

  • Index Cond: ((cid = 224) AND (id = gd_1.property_id))
63. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_property_bank_accounts_cid_prop_bank on property_bank_accounts pba_1 (cost=0.28..0.30 rows=1 width=16) (never executed)

  • Index Cond: ((cid = 224) AND (property_id = gd_1.property_id))
  • Filter: (bank_account_id = ANY ('{5986,5987,148,4109}'::integer[]))
64. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_ap_codes on ap_codes ac_1 (cost=0.29..8.31 rows=1 width=12) (never executed)

  • Index Cond: ((cid = 224) AND (id = pba_1.bank_ap_code_id))
  • Filter: ((ap_code_type_id = 1) AND (item_gl_account_id = ANY ('{160690,160486,305002,304892}'::integer[])))
65. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_bank_accounts on bank_accounts ba_1 (cost=0.28..8.29 rows=1 width=126) (never executed)

  • Index Cond: ((cid = 224) AND (id = pba_1.bank_account_id))
66. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((gd_1.cid = cid) AND (cid = 224) AND (gd_1.gl_reconciliation_id = id))
67. 0.000 0.000 ↓ 0.0 0

Seq Scan on gl_reconciliation_status_types grst (cost=0.00..1.04 rows=4 width=122) (never executed)

68. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ar_deposits_gl_transaction_type_id on ar_deposits ard (cost=0.42..8.44 rows=1 width=16) (never executed)

  • Index Cond: (gl_transaction_type_id = 1)
  • Filter: (cid = 224)
69. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((cid = 224) AND (gl_transaction_type_id = 1))
70. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_details on ap_details ad (cost=0.43..8.45 rows=1 width=20) (never executed)

  • Index Cond: (aa.credit_ap_detail_id = id)
  • Filter: ((cid = 224) AND (aa.cid = cid))
71. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_headers on ap_headers ah (cost=0.42..0.62 rows=1 width=20) (never executed)

  • Index Cond: (ad.ap_header_id = id)
  • Filter: ((cid = 224) AND (ad.cid = cid) AND (ad.gl_transaction_type_id = gl_transaction_type_id) AND (ad.post_month = post_month))
72. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ap_payments_id on ap_payments ap (cost=0.42..0.59 rows=1 width=60) (never executed)

  • Index Cond: (id = ah.ap_payment_id)
  • Filter: ((cid = 224) AND (cid = ah.cid))
73. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_company_users on company_users cu (cost=0.42..0.47 rows=1 width=12) (never executed)

  • Index Cond: ((cid = gd_1.cid) AND (cid = 224) AND (id = gd_1.created_by))
  • Filter: (company_user_type_id = 2)
74. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_company_employees on company_employees ce (cost=0.28..0.37 rows=1 width=244) (never executed)

  • Index Cond: ((cu.cid = cid) AND (cid = 224) AND (id = cu.company_employee_id))
75. 0.000 0.000 ↓ 0.0 0

Seq Scan on time_zones tz (cost=0.00..2.17 rows=17 width=222) (never executed)

76. 0.014 26,813.746 ↓ 11.0 11 1

Subquery Scan on "*SELECT* 3" (cost=294.61..295.28 rows=1 width=895) (actual time=26,813.175..26,813.746 rows=11 loops=1)

77. 10.959 26,813.732 ↓ 11.0 11 1

GroupAggregate (cost=294.61..295.27 rows=1 width=2,204) (actual time=26,813.171..26,813.732 rows=11 loops=1)

  • Group Key: gd_2.property_id, p_2.property_name, ba_2.id, ba_2.account_name, gh_2.reference, gt_2.account_number_pattern, gt_2.account_number_delimiter, gh_2.gl_transaction_type_id, ap_1.payment_memo, gh_2.memo, gh_2.header_number, gtt_1.id, ard_1.deposit_number, ard_1.id, ap_1.payment_number, ap_1.ap_payment_type_id, apt.name, ap_1.payee_name, gh_2.post_month, gh_2.transaction_datetime, gh_2.post_date, grst_1.id, gd_2.memo, (CASE WHEN (gh_2.header_number IS NOT NULL) THEN gh_2.id ELSE NULL::integer END), ah_1.ap_payment_id, gh_2.reference_id, aa_1.allocation_datetime, gr_1.gl_reconciliation_status_type_id, gat_2.formatted_account_number, gat_2.name, ce_1.name_first, ce_1.name_last, ap_1.created_on, tz_1.time_zone_name, gd_2.cid
  • Filter: (sum(gd_2.amount) <> '0'::numeric)
78. 0.216 26,802.773 ↓ 11.0 11 1

Sort (cost=294.61..294.61 rows=1 width=1,937) (actual time=26,802.767..26,802.773 rows=11 loops=1)

  • Sort Key: gd_2.property_id, p_2.property_name, ba_2.id, ba_2.account_name, gh_2.reference, gt_2.account_number_pattern, gt_2.account_number_delimiter, gh_2.gl_transaction_type_id, ap_1.payment_memo, gh_2.memo, gh_2.header_number, gtt_1.id, ard_1.deposit_number, ard_1.id, ap_1.payment_number, ap_1.ap_payment_type_id, apt.name, ap_1.payee_name, gh_2.post_month, gh_2.transaction_datetime, gh_2.post_date, grst_1.id, gd_2.memo, (CASE WHEN (gh_2.header_number IS NOT NULL) THEN gh_2.id ELSE NULL::integer END), ah_1.ap_payment_id, gh_2.reference_id, aa_1.allocation_datetime, gr_1.gl_reconciliation_status_type_id, gat_2.formatted_account_number, gat_2.name, ce_1.name_first, ce_1.name_last, ap_1.created_on, tz_1.time_zone_name
  • Sort Method: quicksort Memory: 30kB
79. 0.052 26,802.557 ↓ 11.0 11 1

Nested Loop Left Join (cost=6.46..294.60 rows=1 width=1,937) (actual time=26,294.188..26,802.557 rows=11 loops=1)

  • Join Filter: (tz_1.id = p_2.time_zone_id)
  • Rows Removed by Join Filter: 66
80. 0.033 26,802.472 ↓ 11.0 11 1

Nested Loop Left Join (cost=6.46..292.21 rows=1 width=1,723) (actual time=26,294.170..26,802.472 rows=11 loops=1)

81. 0.025 26,802.384 ↓ 11.0 11 1

Nested Loop Left Join (cost=6.17..291.84 rows=1 width=1,495) (actual time=26,294.146..26,802.384 rows=11 loops=1)

82. 0.046 26,802.271 ↓ 11.0 11 1

Nested Loop Left Join (cost=5.75..291.37 rows=1 width=1,491) (actual time=26,294.109..26,802.271 rows=11 loops=1)

  • Join Filter: (ap_1.ap_payment_type_id = apt.id)
  • Rows Removed by Join Filter: 45
83. 0.051 26,802.181 ↓ 11.0 11 1

Nested Loop Left Join (cost=5.75..289.05 rows=1 width=1,373) (actual time=26,294.084..26,802.181 rows=11 loops=1)

  • Filter: CASE WHEN (ap_1.payment_number IS NOT NULL) THEN (ba_2.id = ap_1.bank_account_id) ELSE true END
84. 0.027 26,782.880 ↓ 11.0 11 1

Nested Loop Left Join (cost=5.33..288.45 rows=1 width=1,317) (actual time=26,282.077..26,782.880 rows=11 loops=1)

85. 0.031 26,782.743 ↓ 11.0 11 1

Nested Loop Left Join (cost=4.91..287.82 rows=1 width=1,325) (actual time=26,282.032..26,782.743 rows=11 loops=1)

86. 0.029 26,773.461 ↓ 11.0 11 1

Nested Loop Left Join (cost=4.48..286.17 rows=1 width=1,317) (actual time=26,279.814..26,773.461 rows=11 loops=1)

87. 0.018 26,747.725 ↓ 11.0 11 1

Nested Loop Left Join (cost=4.05..277.85 rows=1 width=1,305) (actual time=26,262.155..26,747.725 rows=11 loops=1)

88. 0.044 26,747.652 ↓ 11.0 11 1

Nested Loop Left Join (cost=3.64..270.07 rows=1 width=1,297) (actual time=26,262.134..26,747.652 rows=11 loops=1)

  • Join Filter: (grst_1.id = gr_1.gl_reconciliation_status_type_id)
  • Rows Removed by Join Filter: 44
89. 0.017 26,742.603 ↓ 11.0 11 1

Nested Loop Left Join (cost=3.64..268.98 rows=1 width=1,175) (actual time=26,257.143..26,742.603 rows=11 loops=1)

90. 0.028 26,742.575 ↓ 11.0 11 1

Nested Loop (cost=3.35..268.67 rows=1 width=1,175) (actual time=26,257.137..26,742.575 rows=11 loops=1)

91. 0.034 26,742.492 ↓ 11.0 11 1

Nested Loop (cost=3.08..256.36 rows=1 width=1,061) (actual time=26,257.119..26,742.492 rows=11 loops=1)

  • Join Filter: (pba_2.bank_ap_code_id = ac_2.id)
92. 0.077 26,742.348 ↓ 11.0 11 1

Nested Loop (cost=2.79..254.41 rows=1 width=1,069) (actual time=26,257.048..26,742.348 rows=11 loops=1)

  • Join Filter: ((lp_2.property_id = pba_2.property_id) AND (ga_2.ap_code_id = pba_2.bank_ap_code_id))
  • Rows Removed by Join Filter: 77
93. 0.095 26,741.897 ↓ 22.0 22 1

Nested Loop (cost=2.52..254.10 rows=1 width=1,073) (actual time=4,484.376..26,741.897 rows=22 loops=1)

  • Join Filter: (lp_2.property_id = p_2.id)
94. 0.097 26,741.604 ↓ 22.0 22 1

Nested Loop Left Join (cost=2.24..253.79 rows=1 width=943) (actual time=4,484.344..26,741.604 rows=22 loops=1)

95. 212.023 26,735.743 ↓ 22.0 22 1

Nested Loop (cost=2.10..253.38 rows=1 width=441) (actual time=4,478.702..26,735.743 rows=22 loops=1)

96. 228.248 25,046.223 ↓ 211,071.0 211,071 1

Nested Loop (cost=1.67..252.40 rows=1 width=344) (actual time=219.433..25,046.223 rows=211,071 loops=1)

97. 87.349 24,184.762 ↓ 211,071.0 211,071 1

Nested Loop (cost=1.38..252.09 rows=1 width=348) (actual time=219.415..24,184.762 rows=211,071 loops=1)

98. 16.342 16.342 ↑ 1.0 1 1

Function Scan on load_properties lp_2 (cost=0.25..1.00 rows=1 width=4) (actual time=16.340..16.342 rows=1 loops=1)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
99. 169.334 24,081.071 ↓ 52,767.8 211,071 1

Nested Loop (cost=1.13..251.05 rows=4 width=344) (actual time=203.071..24,081.071 rows=211,071 loops=1)

100. 2.196 8.235 ↓ 1,162.0 1,162 1

Nested Loop (cost=0.56..16.62 rows=1 width=276) (actual time=0.045..8.235 rows=1,162 loops=1)

101. 0.029 0.029 ↑ 1.0 1 1

Index Scan using idx_gl_trees_cid_is_system on gl_trees gt_2 (cost=0.14..8.16 rows=1 width=244) (actual time=0.014..0.029 rows=1 loops=1)

  • Index Cond: (cid = 224)
  • Filter: ((system_code)::text = 'DEFAULT'::text)
102. 6.010 6.010 ↓ 1,162.0 1,162 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat_2 (cost=0.42..8.44 rows=1 width=44) (actual time=0.029..6.010 rows=1,162 loops=1)

  • Index Cond: ((cid = 224) AND (gl_tree_id = gt_2.id))
103. 23,903.502 23,903.502 ↓ 45.5 182 1,162

Index Scan using idx_gl_details_cid_property_id_post_month_cash_gl_account_id on gl_details gd_2 (cost=0.56..234.40 rows=4 width=68) (actual time=17.683..20.571 rows=182 loops=1,162)

  • Index Cond: ((cid = 224) AND (property_id = lp_2.property_id) AND (cash_gl_account_id = gat_2.gl_account_id))
104. 633.213 633.213 ↑ 1.0 1 211,071

Index Scan using idx_gl_accounts_id on gl_accounts ga_2 (cost=0.29..0.31 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=211,071)

  • Index Cond: (id = gd_2.cash_gl_account_id)
  • Filter: (cid = 224)
105. 1,477.497 1,477.497 ↓ 0.0 0 211,071

Index Scan using idx_gl_headers_id on gl_headers gh_2 (cost=0.43..0.97 rows=1 width=101) (actual time=0.007..0.007 rows=0 loops=211,071)

  • Index Cond: (id = gd_2.gl_header_id)
  • Filter: ((is_template IS FALSE) AND (post_month >= '2019-08-01'::date) AND (post_month <= '2019-08-01'::date) AND (cid = 224) AND (gl_book_id = 132) AND (gl_transaction_type_id = ANY ('{2,3,4,5}'::integer[])) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
  • Rows Removed by Filter: 1
106. 5.764 5.764 ↑ 1.0 1 22

Index Scan using pk_gl_transaction_types on gl_transaction_types gtt_1 (cost=0.14..0.39 rows=1 width=502) (actual time=0.262..0.262 rows=1 loops=22)

  • Index Cond: (id = gh_2.gl_transaction_type_id)
107. 0.198 0.198 ↑ 1.0 1 22

Index Scan using pk_properties on properties p_2 (cost=0.28..0.30 rows=1 width=130) (actual time=0.009..0.009 rows=1 loops=22)

  • Index Cond: ((cid = 224) AND (id = gd_2.property_id))
108. 0.374 0.374 ↓ 4.0 4 22

Index Scan using idx_property_bank_accounts_cid_prop_bank on property_bank_accounts pba_2 (cost=0.28..0.30 rows=1 width=16) (actual time=0.012..0.017 rows=4 loops=22)

  • Index Cond: ((cid = 224) AND (property_id = gd_2.property_id))
  • Filter: (bank_account_id = ANY ('{5986,5987,148,4109}'::integer[]))
  • Rows Removed by Filter: 1
109. 0.110 0.110 ↑ 1.0 1 11

Index Scan using pk_ap_codes on ap_codes ac_2 (cost=0.29..1.94 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=11)

  • Index Cond: ((cid = 224) AND (id = ga_2.ap_code_id))
  • Filter: ((ap_code_type_id = 1) AND (item_gl_account_id = ANY ('{160690,160486,305002,304892}'::integer[])))
110. 0.055 0.055 ↑ 1.0 1 11

Index Scan using pk_bank_accounts on bank_accounts ba_2 (cost=0.28..8.29 rows=1 width=126) (actual time=0.005..0.005 rows=1 loops=11)

  • Index Cond: ((cid = 224) AND (id = pba_2.bank_account_id))
111. 0.011 0.011 ↓ 0.0 0 11

Index Scan using pk_gl_reconciliations on gl_reconciliations gr_1 (cost=0.29..0.31 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=11)

  • Index Cond: ((gd_2.cid = cid) AND (cid = 224) AND (gd_2.gl_reconciliation_id = id))
112. 5.005 5.005 ↑ 1.0 4 11

Seq Scan on gl_reconciliation_status_types grst_1 (cost=0.00..1.04 rows=4 width=122) (actual time=0.454..0.455 rows=4 loops=11)

113. 0.055 0.055 ↓ 0.0 0 11

Index Scan using idx_ar_deposits_id on ar_deposits ard_1 (cost=0.42..7.77 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=11)

  • Index Cond: (id = gh_2.reference_id)
  • Filter: ((cid = 224) AND (cid = gh_2.cid) AND (gl_transaction_type_id = gh_2.gl_transaction_type_id))
114. 25.707 25.707 ↑ 1.0 1 11

Index Scan using pk_ap_allocations on ap_allocations aa_1 (cost=0.42..8.32 rows=1 width=24) (actual time=2.337..2.337 rows=1 loops=11)

  • Index Cond: ((cid = gh_2.cid) AND (cid = 224) AND (id = gh_2.reference_id))
  • Filter: (gl_transaction_type_id = gh_2.gl_transaction_type_id)
115. 9.251 9.251 ↑ 1.0 1 11

Index Scan using idx_ap_details on ap_details ad_1 (cost=0.43..1.64 rows=1 width=20) (actual time=0.841..0.841 rows=1 loops=11)

  • Index Cond: (aa_1.credit_ap_detail_id = id)
  • Filter: ((cid = 224) AND (aa_1.cid = cid))
116. 0.110 0.110 ↑ 1.0 1 11

Index Scan using idx_ap_headers on ap_headers ah_1 (cost=0.42..0.62 rows=1 width=20) (actual time=0.010..0.010 rows=1 loops=11)

  • Index Cond: (ad_1.ap_header_id = id)
  • Filter: ((cid = 224) AND (ad_1.cid = cid) AND (ad_1.gl_transaction_type_id = gl_transaction_type_id) AND (ad_1.post_month = post_month))
117. 19.250 19.250 ↑ 1.0 1 11

Index Scan using idx_ap_payments_id on ap_payments ap_1 (cost=0.42..0.59 rows=1 width=72) (actual time=1.750..1.750 rows=1 loops=11)

  • Index Cond: (id = ah_1.ap_payment_id)
  • Filter: ((cid = 224) AND (cid = ah_1.cid))
118. 0.044 0.044 ↑ 2.8 5 11

Seq Scan on ap_payment_types apt (cost=0.00..2.14 rows=14 width=122) (actual time=0.003..0.004 rows=5 loops=11)

119. 0.088 0.088 ↑ 1.0 1 11

Index Scan using pk_company_users on company_users cu_1 (cost=0.42..0.47 rows=1 width=12) (actual time=0.008..0.008 rows=1 loops=11)

  • Index Cond: ((cid = gd_2.cid) AND (cid = 224) AND (id = gd_2.created_by))
  • Filter: (company_user_type_id = 2)
120. 0.055 0.055 ↑ 1.0 1 11

Index Scan using pk_company_employees on company_employees ce_1 (cost=0.28..0.37 rows=1 width=244) (actual time=0.005..0.005 rows=1 loops=11)

  • Index Cond: ((cu_1.cid = cid) AND (cid = 224) AND (id = cu_1.company_employee_id))
121. 0.033 0.033 ↑ 2.4 7 11

Seq Scan on time_zones tz_1 (cost=0.00..2.17 rows=17 width=222) (actual time=0.002..0.003 rows=7 loops=11)

122. 0.004 4,212.825 ↓ 2.0 2 1

Subquery Scan on "*SELECT* 4" (cost=91.16..91.58 rows=1 width=888) (actual time=4,212.819..4,212.825 rows=2 loops=1)

123. 0.064 4,212.821 ↓ 2.0 2 1

GroupAggregate (cost=91.16..91.57 rows=1 width=2,163) (actual time=4,212.815..4,212.821 rows=2 loops=1)

  • Group Key: gd_3.property_id, p_3.property_name, ba_3.id, ba_3.account_name, gtt_2.description, gh_3.reference, gt_3.account_number_pattern, gt_3.account_number_delimiter, gh_3.gl_transaction_type_id, gd_3.memo, gh_3.memo, ap_2.payment_memo, gh_3.header_number, ard_2.deposit_number, ard_2.id, ap_2.payment_number, ap_2.ap_payment_type_id, ap_2.payee_name, gh_3.post_month, gh_3.transaction_datetime, gh_3.post_date, grst_2.id, (CASE WHEN (gh_3.header_number IS NOT NULL) THEN gh_3.id ELSE NULL::integer END), ah_2.ap_payment_id, aa_2.allocation_datetime, gr_2.gl_reconciliation_status_type_id, gat_3.formatted_account_number, gat_3.name, ce_2.name_first, ce_2.name_last, ard_2.created_by, ard_2.created_on, cu_2.username, tz_2.time_zone_name, gd_3.cid
  • Filter: (sum(gd_3.amount) <> '0'::numeric)
  • Rows Removed by Filter: 7
124. 0.284 4,212.757 ↓ 9.0 9 1

Sort (cost=91.16..91.16 rows=1 width=1,828) (actual time=4,212.755..4,212.757 rows=9 loops=1)

  • Sort Key: gd_3.property_id, p_3.property_name, ba_3.id, ba_3.account_name, gtt_2.description, gh_3.reference, gt_3.account_number_pattern, gt_3.account_number_delimiter, gh_3.gl_transaction_type_id, gd_3.memo, gh_3.memo, ap_2.payment_memo, gh_3.header_number, ard_2.deposit_number, ard_2.id, ap_2.payment_number, ap_2.ap_payment_type_id, ap_2.payee_name, gh_3.post_month, gh_3.transaction_datetime, gh_3.post_date, grst_2.id, (CASE WHEN (gh_3.header_number IS NOT NULL) THEN gh_3.id ELSE NULL::integer END), ah_2.ap_payment_id, aa_2.allocation_datetime, gr_2.gl_reconciliation_status_type_id, gat_3.formatted_account_number, gat_3.name, ce_2.name_first, ce_2.name_last, ard_2.created_by, ard_2.created_on, cu_2.username, tz_2.time_zone_name
  • Sort Method: quicksort Memory: 27kB
125. 0.044 4,212.473 ↓ 9.0 9 1

Nested Loop Left Join (cost=5.89..91.15 rows=1 width=1,828) (actual time=4,166.855..4,212.473 rows=9 loops=1)

  • Join Filter: (tz_2.id = p_3.time_zone_id)
  • Rows Removed by Join Filter: 54
126. 0.022 4,212.393 ↓ 9.0 9 1

Nested Loop Left Join (cost=5.89..88.76 rows=1 width=1,614) (actual time=4,166.824..4,212.393 rows=9 loops=1)

127. 0.015 4,212.326 ↓ 9.0 9 1

Nested Loop Left Join (cost=5.61..88.39 rows=1 width=1,386) (actual time=4,166.815..4,212.326 rows=9 loops=1)

128. 0.007 4,212.239 ↓ 9.0 9 1

Nested Loop Left Join (cost=5.19..85.10 rows=1 width=1,369) (actual time=4,166.782..4,212.239 rows=9 loops=1)

129. 0.014 4,212.223 ↓ 9.0 9 1

Nested Loop Left Join (cost=4.77..84.49 rows=1 width=1,321) (actual time=4,166.777..4,212.223 rows=9 loops=1)

130. 0.013 4,212.200 ↓ 9.0 9 1

Nested Loop Left Join (cost=4.34..83.87 rows=1 width=1,329) (actual time=4,166.766..4,212.200 rows=9 loops=1)

131. 0.014 4,212.178 ↓ 9.0 9 1

Nested Loop Left Join (cost=3.92..82.22 rows=1 width=1,321) (actual time=4,166.755..4,212.178 rows=9 loops=1)

132. 0.022 4,205.891 ↓ 9.0 9 1

Nested Loop (cost=3.49..79.03 rows=1 width=1,313) (actual time=4,160.508..4,205.891 rows=9 loops=1)

133. 0.023 4,205.833 ↓ 9.0 9 1

Nested Loop (cost=3.22..78.55 rows=1 width=1,199) (actual time=4,160.490..4,205.833 rows=9 loops=1)

134. 0.029 4,205.720 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.80..77.52 rows=1 width=1,171) (actual time=4,160.460..4,205.720 rows=9 loops=1)

  • Join Filter: (grst_2.id = gr_2.gl_reconciliation_status_type_id)
  • Rows Removed by Join Filter: 36
135. 0.012 4,205.655 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.80..76.43 rows=1 width=1,049) (actual time=4,160.436..4,205.655 rows=9 loops=1)

136. 0.017 4,205.634 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.52..76.08 rows=1 width=1,049) (actual time=4,160.429..4,205.634 rows=9 loops=1)

137. 5.586 4,205.518 ↓ 9.0 9 1

Nested Loop (cost=2.38..75.92 rows=1 width=551) (actual time=4,160.344..4,205.518 rows=9 loops=1)

138. 23.960 4,075.894 ↓ 20,673.0 20,673 1

Nested Loop (cost=1.94..68.38 rows=1 width=454) (actual time=49.703..4,075.894 rows=20,673 loops=1)

139. 64.601 3,989.915 ↓ 20,673.0 20,673 1

Nested Loop (cost=1.66..67.97 rows=1 width=466) (actual time=49.668..3,989.915 rows=20,673 loops=1)

  • Join Filter: (gd_3.property_id = lp_3.property_id)
  • Rows Removed by Join Filter: 133452
140. 168.410 3,771.189 ↓ 154,125.0 154,125 1

Nested Loop (cost=1.41..66.96 rows=1 width=470) (actual time=26.083..3,771.189 rows=154,125 loops=1)

141. 123.890 3,140.404 ↓ 154,125.0 154,125 1

Nested Loop (cost=1.13..66.64 rows=1 width=344) (actual time=26.034..3,140.404 rows=154,125 loops=1)

142. 0.587 2.286 ↓ 1,162.0 1,162 1

Nested Loop (cost=0.56..16.62 rows=1 width=276) (actual time=0.043..2.286 rows=1,162 loops=1)

143. 0.019 0.019 ↑ 1.0 1 1

Index Scan using idx_gl_trees_cid_is_system on gl_trees gt_3 (cost=0.14..8.16 rows=1 width=244) (actual time=0.011..0.019 rows=1 loops=1)

  • Index Cond: (cid = 224)
  • Filter: ((system_code)::text = 'DEFAULT'::text)
144. 1.680 1.680 ↓ 1,162.0 1,162 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat_3 (cost=0.42..8.44 rows=1 width=44) (actual time=0.027..1.680 rows=1,162 loops=1)

  • Index Cond: ((cid = 224) AND (gl_tree_id = gt_3.id))
145. 3,014.228 3,014.228 ↓ 16.6 133 1,162

Index Scan using idx_gl_details_cid_cash_gl_account_id on gl_details gd_3 (cost=0.56..49.94 rows=8 width=68) (actual time=0.044..2.594 rows=133 loops=1,162)

  • Index Cond: ((cid = 224) AND (cash_gl_account_id = gat_3.gl_account_id) AND (cash_gl_account_id = ANY ('{160690,160486,305002,304892}'::integer[])))
146. 462.375 462.375 ↑ 1.0 1 154,125

Index Scan using pk_properties on properties p_3 (cost=0.28..0.32 rows=1 width=130) (actual time=0.003..0.003 rows=1 loops=154,125)

  • Index Cond: ((cid = 224) AND (id = gd_3.property_id))
147. 154.125 154.125 ↑ 1.0 1 154,125

Function Scan on load_properties lp_3 (cost=0.25..1.00 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=154,125)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
148. 62.019 62.019 ↑ 1.0 1 20,673

Index Scan using idx_gl_accounts_id on gl_accounts ga_3 (cost=0.29..0.40 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=20,673)

  • Index Cond: (id = gd_3.cash_gl_account_id)
  • Filter: ((cid = 224) AND (gl_account_type_id = 101))
149. 124.038 124.038 ↓ 0.0 0 20,673

Index Scan using idx_gl_headers_id on gl_headers gh_3 (cost=0.43..7.54 rows=1 width=101) (actual time=0.006..0.006 rows=0 loops=20,673)

  • Index Cond: (id = gd_3.gl_header_id)
  • Filter: ((NOT is_template) AND (post_month >= '2019-08-01'::date) AND (post_month <= '2019-08-01'::date) AND (cid = 224) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])) AND (gl_transaction_type_id = ANY ('{7,8,13,14,15,16}'::integer[])))
  • Rows Removed by Filter: 1
150. 0.099 0.099 ↑ 1.0 1 9

Index Scan using pk_gl_transaction_types on gl_transaction_types gtt_2 (cost=0.14..0.16 rows=1 width=502) (actual time=0.011..0.011 rows=1 loops=9)

  • Index Cond: (id = gh_3.gl_transaction_type_id)
151. 0.009 0.009 ↓ 0.0 0 9

Index Scan using pk_gl_reconciliations on gl_reconciliations gr_2 (cost=0.29..0.35 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: ((gd_3.cid = cid) AND (cid = 224) AND (gd_3.gl_reconciliation_id = id))
152. 0.036 0.036 ↑ 1.0 4 9

Seq Scan on gl_reconciliation_status_types grst_2 (cost=0.00..1.04 rows=4 width=122) (actual time=0.003..0.004 rows=4 loops=9)

153. 0.090 0.090 ↑ 1.0 1 9

Index Scan using idx_ar_deposits_id on ar_deposits ard_2 (cost=0.42..1.02 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=9)

  • Index Cond: (id = gh_3.reference_id)
  • Filter: ((cid = 224) AND (gh_3.gl_transaction_type_id = gl_transaction_type_id) AND (bank_account_id = ANY ('{5986,5987,148,4109}'::integer[])))
154. 0.036 0.036 ↑ 1.0 1 9

Index Scan using pk_bank_accounts on bank_accounts ba_3 (cost=0.28..0.41 rows=1 width=126) (actual time=0.004..0.004 rows=1 loops=9)

  • Index Cond: ((cid = 224) AND (id = ard_2.bank_account_id))
155. 6.273 6.273 ↓ 0.0 0 9

Index Scan using pk_ap_allocations on ap_allocations aa_2 (cost=0.42..3.18 rows=1 width=24) (actual time=0.697..0.697 rows=0 loops=9)

  • Index Cond: ((cid = gh_3.cid) AND (cid = 224) AND (id = gh_3.reference_id))
  • Filter: (gl_transaction_type_id = gh_3.gl_transaction_type_id)
156. 0.009 0.009 ↓ 0.0 0 9

Index Scan using idx_ap_details on ap_details ad_2 (cost=0.43..1.64 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: (aa_2.credit_ap_detail_id = id)
  • Filter: ((cid = 224) AND (aa_2.cid = cid))
157. 0.009 0.009 ↓ 0.0 0 9

Index Scan using idx_ap_headers on ap_headers ah_2 (cost=0.42..0.62 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: (ad_2.ap_header_id = id)
  • Filter: ((cid = 224) AND (ad_2.cid = cid) AND (ad_2.gl_transaction_type_id = gl_transaction_type_id) AND (ad_2.post_month = post_month))
158. 0.009 0.009 ↓ 0.0 0 9

Index Scan using idx_ap_payments_id on ap_payments ap_2 (cost=0.42..0.59 rows=1 width=60) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: (id = ah_2.ap_payment_id)
  • Filter: ((cid = 224) AND (cid = ah_2.cid))
159. 0.072 0.072 ↑ 1.0 1 9

Index Scan using pk_company_users on company_users cu_2 (cost=0.42..3.29 rows=1 width=25) (actual time=0.008..0.008 rows=1 loops=9)

  • Index Cond: ((cid = gd_3.cid) AND (cid = 224) AND (id = gd_3.created_by))
  • Filter: (company_user_type_id = 2)
160. 0.045 0.045 ↑ 1.0 1 9

Index Scan using pk_company_employees on company_employees ce_2 (cost=0.28..0.37 rows=1 width=244) (actual time=0.005..0.005 rows=1 loops=9)

  • Index Cond: ((cu_2.cid = cid) AND (cid = 224) AND (id = cu_2.company_employee_id))
161. 0.036 0.036 ↑ 2.4 7 9

Seq Scan on time_zones tz_2 (cost=0.00..2.17 rows=17 width=222) (actual time=0.003..0.004 rows=7 loops=9)

162. 0.009 26.785 ↓ 4.0 4 11

Materialize (cost=35.58..35.63 rows=1 width=158) (actual time=2.433..2.435 rows=4 loops=11)

163. 0.050 26.776 ↓ 4.0 4 1

GroupAggregate (cost=35.58..35.61 rows=1 width=158) (actual time=26.759..26.776 rows=4 loops=1)

  • Group Key: ba_4.id, ba_4.cid
164. 0.038 26.726 ↓ 4.0 4 1

Sort (cost=35.58..35.59 rows=1 width=157) (actual time=26.725..26.726 rows=4 loops=1)

  • Sort Key: ba_4.id
  • Sort Method: quicksort Memory: 25kB
165. 0.009 26.688 ↓ 4.0 4 1

Nested Loop (cost=1.69..35.57 rows=1 width=157) (actual time=15.497..26.688 rows=4 loops=1)

  • Join Filter: (pba_3.bank_ap_code_id = ac_3.id)
166. 0.008 26.635 ↓ 4.0 4 1

Nested Loop (cost=1.40..33.62 rows=1 width=169) (actual time=15.467..26.635 rows=4 loops=1)

167. 0.351 26.599 ↓ 4.0 4 1

Nested Loop (cost=1.13..21.32 rows=1 width=47) (actual time=15.450..26.599 rows=4 loops=1)

168. 0.763 7.656 ↓ 1,162.0 1,162 1

Nested Loop (cost=0.85..20.93 rows=1 width=39) (actual time=0.075..7.656 rows=1,162 loops=1)

169. 0.565 2.245 ↓ 1,162.0 1,162 1

Nested Loop (cost=0.56..16.62 rows=1 width=39) (actual time=0.064..2.245 rows=1,162 loops=1)

170. 0.024 0.024 ↑ 1.0 1 1

Index Scan using idx_gl_trees_cid_is_system on gl_trees gt_4 (cost=0.14..8.16 rows=1 width=8) (actual time=0.023..0.024 rows=1 loops=1)

  • Index Cond: (cid = 224)
  • Filter: ((system_code)::text = 'DEFAULT'::text)
171. 1.656 1.656 ↓ 1,162.0 1,162 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat_4 (cost=0.42..8.44 rows=1 width=43) (actual time=0.039..1.656 rows=1,162 loops=1)

  • Index Cond: ((cid = 224) AND (gl_tree_id = gt_4.id))
172. 4.648 4.648 ↑ 1.0 1 1,162

Index Scan using idx_gl_accounts_id on gl_accounts ga_4 (cost=0.29..4.31 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=1,162)

  • Index Cond: (id = gat_4.gl_account_id)
  • Filter: (cid = 224)
  • Rows Removed by Filter: 0
173. 18.592 18.592 ↓ 0.0 0 1,162

Index Only Scan using uk_property_bank_accounts_prop_bank on property_bank_accounts pba_3 (cost=0.28..0.38 rows=1 width=12) (actual time=0.016..0.016 rows=0 loops=1,162)

  • Index Cond: ((cid = 224) AND (bank_ap_code_id = ga_4.ap_code_id))
  • Filter: (bank_account_id = ANY ('{5986,5987,148,4109}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 92
174. 0.028 0.028 ↑ 1.0 1 4

Index Scan using pk_bank_accounts on bank_accounts ba_4 (cost=0.28..8.29 rows=1 width=126) (actual time=0.007..0.007 rows=1 loops=4)

  • Index Cond: ((cid = 224) AND (id = pba_3.bank_account_id))
175. 0.044 0.044 ↑ 1.0 1 4

Index Scan using pk_ap_codes on ap_codes ac_3 (cost=0.29..1.94 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=4)

  • Index Cond: ((cid = 224) AND (id = ga_4.ap_code_id))
  • Filter: ((ap_code_type_id = 1) AND (item_gl_account_id = ANY ('{160690,160486,305002,304892}'::integer[])))
Planning time : 266.201 ms