explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fpfC

Settings
# exclusive inclusive rows x rows loops node
1. 303.814 10,980.998 ↓ 445.2 97,052 1

GroupAggregate (cost=2,499,653.30..2,499,934.61 rows=218 width=1,586) (actual time=10,666.623..10,980.998 rows=97,052 loops=1)

  • Group Key: outer_details.property_name, outer_details.account_number, outer_details.is_beginning_balance, outer_details.gl_account, outer_details.post_month, outer_details.post_date, outer_details.transaction_date, outer_details.gl_detail_id, outer_details.property_id, outer_details.lookup_code, outer_details.grouping_gl_account_id, outer_details.account_name, outer_details.gl_transaction_type_id, outer_details.transaction_type, outer_details.transaction_type_id, outer_details.gh_header_id, outer_details.header_number, outer_details.reference_id, outer_details.reference, outer_details.transaction_id, outer_details.memo, outer_details.details, outer_details.ar_code_type_id, outer_details.ar_trigger_id, outer_details.ar_code_id, outer_details.ar_transaction_payment_id, outer_details.ap_payment_id, outer_details.ar_payment_id, outer_details.art_id, outer_details.vendor_id, outer_details.resident, outer_details.bldg_unit, outer_details.display_number, outer_details.lease_id, outer_details.occupancy_type_id, outer_details.customer_id, outer_details.beginning_balance, outer_details.hide_zero_beginning_balance_for_no_activities, outer_details.min_debit, outer_details.min_credit, outer_details.min_beginning_balance, outer_details.max_debit, outer_details.max_credit, outer_details.max_beginning_balance
2. 2,096.914 10,677.184 ↓ 45.2 98,123 1

Sort (cost=2,499,653.30..2,499,658.73 rows=2,172 width=1,554) (actual time=10,666.600..10,677.184 rows=98,123 loops=1)

  • Sort Key: outer_details.property_name, outer_details.account_number, outer_details.is_beginning_balance DESC, outer_details.gl_account, outer_details.post_month, outer_details.post_date, outer_details.transaction_date, outer_details.gl_detail_id, outer_details.property_id, outer_details.lookup_code, outer_details.grouping_gl_account_id, outer_details.account_name, outer_details.gl_transaction_type_id, outer_details.transaction_type, outer_details.transaction_type_id, outer_details.gh_header_id, outer_details.header_number, outer_details.reference_id, outer_details.reference, outer_details.transaction_id, outer_details.memo, outer_details.details, outer_details.ar_code_type_id, outer_details.ar_trigger_id, outer_details.ar_code_id, outer_details.ar_transaction_payment_id, outer_details.ap_payment_id, outer_details.ar_payment_id, outer_details.art_id, outer_details.vendor_id, outer_details.resident, outer_details.bldg_unit, outer_details.display_number, outer_details.lease_id, outer_details.occupancy_type_id, outer_details.customer_id, outer_details.beginning_balance, outer_details.hide_zero_beginning_balance_for_no_activities, outer_details.min_debit, outer_details.min_credit, outer_details.min_beginning_balance, outer_details.max_debit, outer_details.max_credit, outer_details.max_beginning_balance
  • Sort Method: quicksort Memory: 65263kB
3. 24.865 8,580.270 ↓ 45.2 98,123 1

Subquery Scan on outer_details (cost=2,499,336.45..2,499,532.92 rows=2,172 width=1,554) (actual time=8,362.538..8,580.270 rows=98,123 loops=1)

  • Filter: (outer_details.hide_zero_beginning_balance_for_no_activities <> 1)
  • Rows Removed by Filter: 83
4. 185.632 8,555.405 ↓ 45.0 98,206 1

WindowAgg (cost=2,499,336.45..2,499,461.97 rows=2,183 width=1,590) (actual time=8,362.536..8,555.405 rows=98,206 loops=1)

5. 245.556 8,369.773 ↓ 45.0 98,206 1

Sort (cost=2,499,336.45..2,499,341.91 rows=2,183 width=1,362) (actual time=8,362.519..8,369.773 rows=98,206 loops=1)

  • Sort Key: details.property_id, details.gl_account
  • Sort Method: quicksort Memory: 59138kB
6. 152.839 8,124.217 ↓ 45.0 98,206 1

WindowAgg (cost=2,499,128.06..2,499,215.38 rows=2,183 width=1,362) (actual time=7,964.278..8,124.217 rows=98,206 loops=1)

7. 279.544 7,971.378 ↓ 45.0 98,206 1

Sort (cost=2,499,128.06..2,499,133.52 rows=2,183 width=1,354) (actual time=7,964.253..7,971.378 rows=98,206 loops=1)

  • Sort Key: details.property_id, details.grouping_gl_account_id
  • Sort Method: quicksort Memory: 56974kB
8. 31.764 7,691.834 ↓ 45.0 98,206 1

Subquery Scan on details (cost=1,848.04..2,499,006.99 rows=2,183 width=1,354) (actual time=5.352..7,691.834 rows=98,206 loops=1)

9. 11.628 7,660.070 ↓ 45.0 98,206 1

Append (cost=1,848.04..2,498,941.50 rows=2,183 width=1,390) (actual time=5.350..7,660.070 rows=98,206 loops=1)

10. 47.335 7,646.154 ↓ 53.6 97,840 1

Result (cost=1,848.04..2,498,802.01 rows=1,827 width=1,376) (actual time=5.350..7,646.154 rows=97,840 loops=1)

11. 11.202 7,598.819 ↓ 53.6 97,840 1

Append (cost=1,848.04..2,498,742.63 rows=1,827 width=1,348) (actual time=5.347..7,598.819 rows=97,840 loops=1)

12. 1,330.954 7,023.289 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,848.04..2,492,720.36 rows=1,760 width=644) (actual time=5.346..7,023.289 rows=91,372 loops=1)

13. 68.909 5,600.963 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,847.75..2,490,082.29 rows=1,760 width=594) (actual time=2.957..5,600.963 rows=91,372 loops=1)

14. 75.087 5,166.566 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,847.32..2,487,797.66 rows=1,760 width=543) (actual time=2.923..5,166.566 rows=91,372 loops=1)

  • Join Filter: (gh.cid = art1.cid)
15. 160.002 3,172.667 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,846.60..2,478,240.95 rows=1,760 width=306) (actual time=2.873..3,172.667 rows=91,372 loops=1)

  • Join Filter: (gh.gl_transaction_type_id = ANY ('{7,8,9,17}'::integer[]))
  • Rows Removed by Join Filter: 41848
16. 99.385 2,464.433 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=472.22..57,431.02 rows=1,760 width=294) (actual time=2.836..2,464.433 rows=91,372 loops=1)

  • Join Filter: (gh.gl_transaction_type_id = ANY ('{13,14,18,23,24}'::integer[]))
17. 41.858 903.096 ↓ 51.9 91,372 1

Hash Join (cost=471.78..56,017.65 rows=1,760 width=286) (actual time=2.812..903.096 rows=91,372 loops=1)

  • Hash Cond: (gh.gl_transaction_type_id = gtty.id)
18. 23.803 861.208 ↓ 51.9 91,372 1

Nested Loop (cost=468.10..56,007.32 rows=1,760 width=266) (actual time=2.769..861.208 rows=91,372 loops=1)

19. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on load_prop (cost=0.00..1.03 rows=1 width=28) (actual time=0.005..0.006 rows=1 loops=1)

  • Filter: (property_id = 503992)
20. 54.837 837.399 ↓ 51.9 91,372 1

Nested Loop (cost=468.10..55,953.48 rows=1,760 width=242) (actual time=2.762..837.399 rows=91,372 loops=1)

21. 39.916 234.330 ↓ 6.2 91,372 1

Hash Join (cost=467.66..23,063.09 rows=14,787 width=145) (actual time=2.709..234.330 rows=91,372 loops=1)

  • Hash Cond: (gd.accrual_gl_account_id = gat.gl_account_id)
22. 192.550 192.550 ↓ 4.0 91,982 1

Index Scan using idx_gl_details_cid_property_id_post_month_accrual_gl_account_id on gl_details gd (cost=0.56..22,065.73 rows=23,108 width=80) (actual time=0.828..192.550 rows=91,982 loops=1)

  • Index Cond: ((cid = 14181) AND (property_id = 503992) AND (post_month >= '2019-07-01'::date) AND (post_month <= '2019-09-01'::date))
  • Filter: (gl_transaction_type_id = ANY ('{13,14,18,23,24,7,8,9,17}'::integer[]))
  • Rows Removed by Filter: 6490
23. 0.512 1.864 ↑ 1.0 571 1

Hash (cost=448.54..448.54 rows=571 width=77) (actual time=1.864..1.864 rows=571 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 70kB
24. 1.352 1.352 ↑ 1.0 571 1

Seq Scan on gat_temp gat (cost=0.00..448.54 rows=571 width=77) (actual time=0.008..1.352 rows=571 loops=1)

  • Filter: ((cid = 14181) AND (grouping_gl_account_id = ANY ('{276755,277181,276723,282512,277994,282520,277182,276734,276746,276756,276757,276747,276758,276759,277856,305890,276760,277858,276761,276762,305887,276763,276764,276765,276766,282511,276752,276744,276751,276767,276768,276769,276770,279436,282510,276771,276772,276773,276774,276775,276776,276777,281803,276778,276779,281804,276780,276781,276782,281805,276783,281806,276784,281807,276785,281808,276786,281809,305917,305918,276787,281810,276788,281811,276789,281812,276790,281813,276791,281814,276792,281815,276793,276794,282471,305892,305891,305919,305920,305924,305925,306536,306537,305894,305893,276795,281816,276796,281817,276797,281818,276798,281819,276799,281820,276800,281821,276801,281822,276802,276803,281823,276804,281774,276805,281839,276806,281824,276807,281825,276808,281826,276809,281832,276810,281833,276811,281834,276812,281835,276813,276814,281836,276815,281837,276816,281838,276817,281827,276818,281828,276819,276820,281829,276821,282513,276822,276823,281830,276824,282521,276825,276826,276827,276828,276829,276830,276831,276832,276833,282524,276834,282522,276835,305868,276836,276837,276838,276839,276840,306544,276841,276842,276843,276844,276845,306545,277861,276745,276846,276847,276848,276719,276849,276738,276750,279435,276754,278169,276733,276851,276749,276852,276853,276854,276855,276856,276857,277823,276858,276859,276860,276861,276862,276863,276864,276865,276866,305856,276867,276868,276869,276870,276871,276872,276873,276748,276874,276742,276876,276753,276878,276879,276880,276881,277862,276882,276740,276739,276730,276731,276883,276736,276735,276737,276884,276885,276886,276887,276888,276889,276890,276891,277866,277867,276892,276893,276894,276895,276896,276897,276898,276899,276900,276901,276902,276903,276904,276905,276906,276907,276908,276909,276910,276911,276912,276913,276914,276915,276916,276917,276918,276919,276920,276921,276922,276923,276924,276925,276926,276927,276928,276929,276930,276931,276932,276933,276934,276935,276936,276937,276938,276939,276940,276941,276727,276942,276943,276944,276945,276946,276947,276948,276949,276732,276726,276724,276950,276951,276952,276953,276954,276725,276955,276956,276957,276958,276959,276960,276961,276721,276962,276963,276964,276965,276966,276967,276968,276969,276970,276971,276972,276973,276729,276974,276975,276976,276977,276978,276979,276980,276981,276982,276983,276720,276741,276743,276728,276985,276986,276987,276988,276989,276990,276991,276992,276993,276994,276995,276996,276997,276998,276999,277000,277001,277002,277003,277004,277005,277006,277007,277008,282036,277009,277010,277011,277012,277013,277014,277015,277016,277017,277868,277018,277019,277869,277179,277180,277020,277021,277022,277023,277024,277025,277026,277027,277870,277028,276722,277029,277871,277030,305849,277031,277032,277033,277034,277035,277036,277037,277038,277039,277040,277041,277042,277043,277044,277045,277046,277047,277048,277049,277050,277051,277052,277053,277054,277055,277056,277057,277058,277059,277060,277061,277062,277063,277064,277065,277066,277067,277068,277069,277070,277071,277072,277073,277074,277075,277076,277077,277078,277079,277080,277081,277082,277083,277084,277085,277086,277087,277088,277089,277090,277091,277092,277093,277094,277095,277096,277097,277098,277099,277100,277101,277102,277103,277872,277104,277105,277106,277107,277108,277109,277110,277111,276984,277112,282523,277113,277114,281776,281777,281778,281779,281780,281781,281782,281783,281784,281785,281786,281787,281788,281789,281790,281791,281792,281793,281794,305866,277115,277116,277117,277118,277857,277873,277874,277875,277119,277120,277121,277122,277123,277124,277125,277126,277127,277128,277129,277130,277131,277132,277133,277134,277135,277136,277137,277138,277139,277140,305915,277141,277142,277143,277144,277145,277146,277147,277148,277149,277150,277151,277152,277153,277154,277155,277156,277157,277158,277159,277160,277161,277162,277163,277164,277165,277166,277167,277168,277169,277170,277171,277172,277173,277174,282536,277175,277176,277177,305867,277178}'::integer[])))
  • Rows Removed by Filter: 18
25. 548.232 548.232 ↑ 1.0 1 91,372

Index Scan using pk_gl_headers on gl_headers gh (cost=0.43..2.22 rows=1 width=101) (actual time=0.006..0.006 rows=1 loops=91,372)

  • Index Cond: ((cid = 14181) AND (id = gd.gl_header_id))
  • Filter: ((NOT is_template) AND (gl_book_id = 103) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
26. 0.009 0.030 ↑ 1.0 27 1

Hash (cost=2.81..2.81 rows=27 width=24) (actual time=0.030..0.030 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
27. 0.021 0.021 ↑ 1.0 27 1

Seq Scan on gl_transaction_types gtty (cost=0.00..2.81 rows=27 width=24) (actual time=0.006..0.021 rows=27 loops=1)

28. 1,461.952 1,461.952 ↓ 0.0 0 91,372

Index Scan using pk_ar_allocations on ar_allocations ara (cost=0.43..0.77 rows=1 width=16) (actual time=0.016..0.016 rows=0 loops=91,372)

  • Index Cond: ((cid = gh.cid) AND (cid = 14181) AND (id = gh.reference_id))
29. 182.744 548.232 ↑ 1.0 1 91,372

Bitmap Heap Scan on ar_transactions art (cost=1,374.39..1,375.43 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=91,372)

  • Recheck Cond: (((cid = 14181) AND (id = gh.reference_id)) OR ((cid = 14181) AND (id = ara.credit_ar_transaction_id)))
  • Filter: (gh.cid = cid)
  • Heap Blocks: exact=91610
30. 0.000 365.488 ↓ 0.0 0 91,372

BitmapOr (cost=1,374.39..1,374.39 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=91,372)

31. 274.116 274.116 ↑ 1.0 1 91,372

Bitmap Index Scan on pk_ar_transactions (cost=0.00..0.49 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=91,372)

  • Index Cond: ((cid = 14181) AND (id = gh.reference_id))
32. 91.372 91.372 ↓ 0.0 0 91,372

Bitmap Index Scan on pk_ar_transactions (cost=0.00..0.48 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=91,372)

  • Index Cond: ((cid = 14181) AND (id = ara.credit_ar_transaction_id))
33. 0.000 1,918.812 ↑ 1.0 1 91,372

Nested Loop Left Join (cost=0.72..5.40 rows=1 width=249) (actual time=0.015..0.021 rows=1 loops=91,372)

34. 182.744 548.232 ↑ 1.0 1 91,372

Nested Loop Left Join (cost=0.58..0.97 rows=1 width=232) (actual time=0.005..0.006 rows=1 loops=91,372)

35. 274.116 274.116 ↑ 1.0 1 91,372

Index Scan using pk_ar_transactions on ar_transactions art1 (cost=0.43..0.79 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=91,372)

  • Index Cond: ((cid = 14181) AND (id = COALESCE(ara.charge_ar_transaction_id, art.id)))
36. 91.372 91.372 ↑ 1.0 1 91,372

Index Scan using pk_ar_triggers on ar_triggers att (cost=0.14..0.18 rows=1 width=18) (actual time=0.001..0.001 rows=1 loops=91,372)

  • Index Cond: (art1.ar_trigger_id = id)
37. 1,370.580 1,370.580 ↑ 1.0 1 91,372

Index Scan using idx_temp_cid on ar_codes_temp ac (cost=0.14..4.39 rows=1 width=25) (actual time=0.009..0.015 rows=1 loops=91,372)

  • Index Cond: ((cid = art1.cid) AND (cid = 14181))
  • Filter: (id = art1.ar_code_id)
  • Rows Removed by Filter: 99
38. 365.488 365.488 ↑ 1.0 1 91,372

Index Scan using pk_cached_leases on cached_leases cl (cost=0.42..1.30 rows=1 width=63) (actual time=0.004..0.004 rows=1 loops=91,372)

  • Index Cond: ((cid = gd.cid) AND (cid = 14181) AND (id = gd.lease_id))
39. 91.372 91.372 ↓ 0.0 0 91,372

Index Scan using idx_ar_deposits_id on ar_deposits ad (cost=0.29..0.59 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=91,372)

  • Index Cond: (gh.reference_id = id)
  • Filter: ((cid = 14181) AND (gh.gl_transaction_type_id = gl_transaction_type_id))
40. 2.496 564.328 ↓ 96.5 6,468 1

Subquery Scan on *SELECT* 2 (cost=528.20..5,969.47 rows=67 width=522) (actual time=6.820..564.328 rows=6,468 loops=1)

41. 40.907 561.832 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=528.20..5,967.46 rows=67 width=522) (actual time=6.817..561.832 rows=6,468 loops=1)

42. 4.369 507.989 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=527.79..5,887.13 rows=67 width=484) (actual time=6.757..507.989 rows=6,468 loops=1)

43. 1.972 503.620 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=527.37..5,842.90 rows=67 width=479) (actual time=6.746..503.620 rows=6,468 loops=1)

44. 6.803 475.776 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=526.94..5,798.67 rows=67 width=470) (actual time=6.316..475.776 rows=6,468 loops=1)

45. 1.753 468.973 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=526.52..5,755.59 rows=67 width=441) (actual time=6.311..468.973 rows=6,468 loops=1)

46. 2.591 460.752 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=526.09..5,708.36 rows=67 width=433) (actual time=6.289..460.752 rows=6,468 loops=1)

47. 4.248 432.289 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=525.66..5,673.26 rows=67 width=437) (actual time=6.265..432.289 rows=6,468 loops=1)

48. 7.739 428.041 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=525.24..5,619.83 rows=67 width=433) (actual time=6.259..428.041 rows=6,468 loops=1)

49. 5.798 413.834 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=524.81..5,578.06 rows=67 width=393) (actual time=6.221..413.834 rows=6,468 loops=1)

50. 3.890 408.036 ↓ 96.5 6,468 1

Hash Left Join (cost=524.53..5,554.61 rows=67 width=410) (actual time=6.213..408.036 rows=6,468 loops=1)

  • Hash Cond: ((gd_1.cid = pu.cid) AND (CASE WHEN (gd_1.gl_transaction_type_id = 1) THEN gd_1.property_unit_id ELSE COALESCE(ad1.property_unit_id, ad_1.property_unit_id) END = pu.id))
51. 3.472 403.777 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=473.08..5,500.56 rows=67 width=418) (actual time=5.823..403.777 rows=6,468 loops=1)

52. 1.191 251.541 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=472.65..5,405.67 rows=67 width=370) (actual time=4.518..251.541 rows=6,468 loops=1)

53. 2.028 198.606 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=472.21..5,325.60 rows=67 width=318) (actual time=3.929..198.606 rows=6,468 loops=1)

  • Join Filter: (gh_1.gl_transaction_type_id = ANY ('{4,5}'::integer[]))
54. 2.786 125.430 ↓ 96.5 6,468 1

Hash Join (cost=471.78..5,287.90 rows=67 width=306) (actual time=1.526..125.430 rows=6,468 loops=1)

  • Hash Cond: (gh_1.gl_transaction_type_id = gtty_1.id)
55. 7.143 122.623 ↓ 96.5 6,468 1

Nested Loop (cost=468.10..5,283.98 rows=67 width=282) (actual time=1.490..122.623 rows=6,468 loops=1)

56. 3.174 70.064 ↓ 11.5 6,488 1

Hash Join (cost=467.66..4,427.10 rows=566 width=185) (actual time=1.437..70.064 rows=6,488 loops=1)

  • Hash Cond: (gd_1.accrual_gl_account_id = gat_1.gl_account_id)
57. 1.348 65.570 ↓ 7.3 6,490 1

Nested Loop (cost=0.56..3,939.71 rows=885 width=120) (actual time=0.095..65.570 rows=6,490 loops=1)

58. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on load_prop load_prop_1 (cost=0.00..1.03 rows=1 width=28) (actual time=0.007..0.008 rows=1 loops=1)

59. 64.214 64.214 ↓ 7.3 6,490 1

Index Scan using idx_gl_details_cid_property_id_post_month_accrual_gl_account_id on gl_details gd_1 (cost=0.56..3,912.13 rows=885 width=96) (actual time=0.085..64.214 rows=6,490 loops=1)

  • Index Cond: ((cid = 14181) AND (property_id = load_prop_1.property_id) AND (post_month >= '2019-07-01'::date) AND (post_month <= '2019-09-01'::date))
  • Filter: (gl_transaction_type_id <> ALL ('{13,14,18,23,24,7,8,9,17}'::integer[]))
  • Rows Removed by Filter: 91982
60. 0.271 1.320 ↑ 1.0 571 1

Hash (cost=448.54..448.54 rows=571 width=77) (actual time=1.320..1.320 rows=571 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 70kB
61. 1.049 1.049 ↑ 1.0 571 1

Seq Scan on gat_temp gat_1 (cost=0.00..448.54 rows=571 width=77) (actual time=0.008..1.049 rows=571 loops=1)

  • Filter: ((cid = 14181) AND (grouping_gl_account_id = ANY ('{276755,277181,276723,282512,277994,282520,277182,276734,276746,276756,276757,276747,276758,276759,277856,305890,276760,277858,276761,276762,305887,276763,276764,276765,276766,282511,276752,276744,276751,276767,276768,276769,276770,279436,282510,276771,276772,276773,276774,276775,276776,276777,281803,276778,276779,281804,276780,276781,276782,281805,276783,281806,276784,281807,276785,281808,276786,281809,305917,305918,276787,281810,276788,281811,276789,281812,276790,281813,276791,281814,276792,281815,276793,276794,282471,305892,305891,305919,305920,305924,305925,306536,306537,305894,305893,276795,281816,276796,281817,276797,281818,276798,281819,276799,281820,276800,281821,276801,281822,276802,276803,281823,276804,281774,276805,281839,276806,281824,276807,281825,276808,281826,276809,281832,276810,281833,276811,281834,276812,281835,276813,276814,281836,276815,281837,276816,281838,276817,281827,276818,281828,276819,276820,281829,276821,282513,276822,276823,281830,276824,282521,276825,276826,276827,276828,276829,276830,276831,276832,276833,282524,276834,282522,276835,305868,276836,276837,276838,276839,276840,306544,276841,276842,276843,276844,276845,306545,277861,276745,276846,276847,276848,276719,276849,276738,276750,279435,276754,278169,276733,276851,276749,276852,276853,276854,276855,276856,276857,277823,276858,276859,276860,276861,276862,276863,276864,276865,276866,305856,276867,276868,276869,276870,276871,276872,276873,276748,276874,276742,276876,276753,276878,276879,276880,276881,277862,276882,276740,276739,276730,276731,276883,276736,276735,276737,276884,276885,276886,276887,276888,276889,276890,276891,277866,277867,276892,276893,276894,276895,276896,276897,276898,276899,276900,276901,276902,276903,276904,276905,276906,276907,276908,276909,276910,276911,276912,276913,276914,276915,276916,276917,276918,276919,276920,276921,276922,276923,276924,276925,276926,276927,276928,276929,276930,276931,276932,276933,276934,276935,276936,276937,276938,276939,276940,276941,276727,276942,276943,276944,276945,276946,276947,276948,276949,276732,276726,276724,276950,276951,276952,276953,276954,276725,276955,276956,276957,276958,276959,276960,276961,276721,276962,276963,276964,276965,276966,276967,276968,276969,276970,276971,276972,276973,276729,276974,276975,276976,276977,276978,276979,276980,276981,276982,276983,276720,276741,276743,276728,276985,276986,276987,276988,276989,276990,276991,276992,276993,276994,276995,276996,276997,276998,276999,277000,277001,277002,277003,277004,277005,277006,277007,277008,282036,277009,277010,277011,277012,277013,277014,277015,277016,277017,277868,277018,277019,277869,277179,277180,277020,277021,277022,277023,277024,277025,277026,277027,277870,277028,276722,277029,277871,277030,305849,277031,277032,277033,277034,277035,277036,277037,277038,277039,277040,277041,277042,277043,277044,277045,277046,277047,277048,277049,277050,277051,277052,277053,277054,277055,277056,277057,277058,277059,277060,277061,277062,277063,277064,277065,277066,277067,277068,277069,277070,277071,277072,277073,277074,277075,277076,277077,277078,277079,277080,277081,277082,277083,277084,277085,277086,277087,277088,277089,277090,277091,277092,277093,277094,277095,277096,277097,277098,277099,277100,277101,277102,277103,277872,277104,277105,277106,277107,277108,277109,277110,277111,276984,277112,282523,277113,277114,281776,281777,281778,281779,281780,281781,281782,281783,281784,281785,281786,281787,281788,281789,281790,281791,281792,281793,281794,305866,277115,277116,277117,277118,277857,277873,277874,277875,277119,277120,277121,277122,277123,277124,277125,277126,277127,277128,277129,277130,277131,277132,277133,277134,277135,277136,277137,277138,277139,277140,305915,277141,277142,277143,277144,277145,277146,277147,277148,277149,277150,277151,277152,277153,277154,277155,277156,277157,277158,277159,277160,277161,277162,277163,277164,277165,277166,277167,277168,277169,277170,277171,277172,277173,277174,282536,277175,277176,277177,305867,277178}'::integer[])))
  • Rows Removed by Filter: 18
62. 45.416 45.416 ↑ 1.0 1 6,488

Index Scan using pk_gl_headers on gl_headers gh_1 (cost=0.43..1.51 rows=1 width=101) (actual time=0.007..0.007 rows=1 loops=6,488)

  • Index Cond: ((cid = 14181) AND (id = gd_1.gl_header_id))
  • Filter: ((is_template IS FALSE) AND (gl_book_id = 103) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
  • Rows Removed by Filter: 0
63. 0.007 0.021 ↑ 1.0 27 1

Hash (cost=2.81..2.81 rows=27 width=24) (actual time=0.021..0.021 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
64. 0.014 0.014 ↑ 1.0 27 1

Seq Scan on gl_transaction_types gtty_1 (cost=0.00..2.81 rows=27 width=24) (actual time=0.006..0.014 rows=27 loops=1)

65. 71.148 71.148 ↓ 0.0 0 6,468

Index Scan using pk_ap_allocations on ap_allocations aa (cost=0.43..0.53 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=6,468)

  • Index Cond: ((gh_1.cid = cid) AND (cid = 14181) AND (gh_1.reference_id = id))
  • Filter: (gl_transaction_type_id = gh_1.gl_transaction_type_id)
66. 51.744 51.744 ↓ 0.0 0 6,468

Index Scan using idx_ap_details on ap_details ad_1 (cost=0.43..1.17 rows=1 width=60) (actual time=0.008..0.008 rows=0 loops=6,468)

  • Index Cond: (aa.credit_ap_detail_id = id)
  • Filter: ((cid = 14181) AND (aa.cid = cid))
67. 148.764 148.764 ↑ 1.0 1 6,468

Index Scan using idx_ap_details on ap_details ad1 (cost=0.43..1.39 rows=1 width=60) (actual time=0.023..0.023 rows=1 loops=6,468)

  • Index Cond: (id = COALESCE(gd_1.ap_detail_id, aa.charge_ap_detail_id))
  • Filter: (cid = COALESCE(gd_1.cid, aa.cid))
68. 0.189 0.369 ↑ 1.0 703 1

Hash (cost=26.85..26.85 rows=703 width=12) (actual time=0.369..0.369 rows=703 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
69. 0.180 0.180 ↑ 1.0 703 1

Seq Scan on property_units_temp pu (cost=0.00..26.85 rows=703 width=12) (actual time=0.013..0.180 rows=703 loops=1)

  • Filter: (cid = 14181)
70. 0.000 0.000 ↓ 0.0 0 6,468

Index Scan using idx_id on property_buildings_temp pb (cost=0.28..0.32 rows=1 width=11) (actual time=0.000..0.000 rows=0 loops=6,468)

  • Index Cond: (id = CASE WHEN (gd_1.gl_transaction_type_id = 1) THEN gd_1.property_building_id ELSE COALESCE(ad1.property_building_id, ad_1.property_building_id, gd_1.property_building_id) END)
  • Filter: ((cid = 14181) AND (cid = gd_1.cid))
71. 6.468 6.468 ↓ 0.0 0 6,468

Index Scan using idx_ap_headers on ap_headers ah (cost=0.43..0.59 rows=1 width=60) (actual time=0.001..0.001 rows=0 loops=6,468)

  • Index Cond: (ad_1.ap_header_id = id)
  • Filter: ((cid = 14181) AND (ad_1.cid = cid) AND (ad_1.gl_transaction_type_id = gl_transaction_type_id) AND (ad_1.post_month = post_month))
72. 0.000 0.000 ↓ 0.0 0 6,468

Index Scan using idx_ap_headers on ap_headers ah1 (cost=0.43..0.77 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=6,468)

  • Index Cond: (id = aa.lump_ap_header_id)
  • Filter: ((cid = 14181) AND (cid = aa.cid))
73. 25.872 25.872 ↑ 1.0 1 6,468

Index Scan using idx_ap_headers on ap_headers ah2 (cost=0.43..0.49 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=6,468)

  • Index Cond: (ad1.ap_header_id = id)
  • Filter: ((ad1.cid = cid) AND (ad1.gl_transaction_type_id = gl_transaction_type_id) AND (ad1.post_month = post_month))
74. 6.468 6.468 ↓ 0.0 0 6,468

Index Scan using pk_lease_customers on lease_customers lc (cost=0.42..0.70 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=6,468)

  • Index Cond: ((cid = COALESCE(ah2.cid, ah.cid)) AND (id = COALESCE(ah2.lease_customer_id, ah.lease_customer_id)))
75. 0.000 0.000 ↓ 0.0 0 6,468

Index Scan using idx_customers_id on customers cust (cost=0.43..0.61 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=6,468)

  • Index Cond: (id = lc.customer_id)
  • Filter: (cid = lc.cid)
  • Rows Removed by Filter: 0
76. 25.872 25.872 ↓ 0.0 0 6,468

Index Scan using idx_ap_payments_id on ap_payments ap_ref (cost=0.42..0.63 rows=1 width=17) (actual time=0.004..0.004 rows=0 loops=6,468)

  • Index Cond: (id = ah.ap_payment_id)
  • Filter: ((cid = 14181) AND (cid = ah.cid))
77. 0.000 0.000 ↓ 0.0 0 6,468

Index Scan using idx_ap_payments_id on ap_payments ap (cost=0.42..0.63 rows=1 width=17) (actual time=0.000..0.000 rows=0 loops=6,468)

  • Index Cond: (id = ah1.ap_payment_id)
  • Filter: ((cid = 14181) AND (cid = ah1.cid))
78. 12.936 12.936 ↑ 1.0 1 6,468

Index Scan using idx_ap_payees_id on ap_payees app (cost=0.41..0.47 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=6,468)

  • Index Cond: (id = COALESCE(ah.ap_payee_id, ah2.ap_payee_id))
  • Filter: (cid = COALESCE(ah.cid, ah2.cid))
79. 0.151 2.288 ↓ 1.0 366 1

Subquery Scan on *SELECT* 3 (cost=113.68..139.49 rows=356 width=579) (actual time=1.959..2.288 rows=366 loops=1)

80. 0.534 2.137 ↓ 1.0 366 1

HashAggregate (cost=113.68..126.14 rows=356 width=495) (actual time=1.955..2.137 rows=366 loops=1)

  • Group Key: p.id, p.property_name, p.lookup_code, gat_2.grouping_gl_account_id, gat_2.formatted_account_number, gat_2.name, gat_2.gl_account
81. 0.055 1.603 ↓ 1.0 367 1

Nested Loop (cost=64.27..105.67 rows=356 width=101) (actual time=0.382..1.603 rows=367 loops=1)

  • Join Filter: (p.id = load_prop_2.property_id)
82. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on load_prop load_prop_2 (cost=0.00..1.03 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

83. 0.307 1.542 ↓ 17.5 367 1

Nested Loop (cost=64.27..103.95 rows=21 width=105) (actual time=0.373..1.542 rows=367 loops=1)

84. 0.112 0.501 ↓ 16.7 367 1

Hash Join (cost=63.99..79.88 rows=22 width=48) (actual time=0.356..0.501 rows=367 loops=1)

  • Hash Cond: (bbt.property_id = p.id)
85. 0.054 0.054 ↑ 1.0 367 1

Seq Scan on beg_bal_temp bbt (cost=0.00..14.93 rows=367 width=18) (actual time=0.008..0.054 rows=367 loops=1)

  • Filter: (cid = 14181)
86. 0.023 0.335 ↑ 1.0 66 1

Hash (cost=61.85..61.85 rows=66 width=34) (actual time=0.335..0.335 rows=66 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
87. 0.312 0.312 ↑ 1.0 66 1

Index Scan using idx_properties_cid_id_is_disabled_remote_primary_key on properties p (cost=0.28..61.85 rows=66 width=34) (actual time=0.038..0.312 rows=66 loops=1)

  • Index Cond: (cid = 14181)
88. 0.734 0.734 ↑ 1.0 1 367

Index Scan using idx_temp_gat_gl_account_id on gat_temp gat_2 (cost=0.28..1.06 rows=1 width=73) (actual time=0.002..0.002 rows=1 loops=367)

  • Index Cond: (gl_account_id = bbt.gl_account_id)
  • Filter: ((cid = 14181) AND (grouping_gl_account_id = ANY ('{276755,277181,276723,282512,277994,282520,277182,276734,276746,276756,276757,276747,276758,276759,277856,305890,276760,277858,276761,276762,305887,276763,276764,276765,276766,282511,276752,276744,276751,276767,276768,276769,276770,279436,282510,276771,276772,276773,276774,276775,276776,276777,281803,276778,276779,281804,276780,276781,276782,281805,276783,281806,276784,281807,276785,281808,276786,281809,305917,305918,276787,281810,276788,281811,276789,281812,276790,281813,276791,281814,276792,281815,276793,276794,282471,305892,305891,305919,305920,305924,305925,306536,306537,305894,305893,276795,281816,276796,281817,276797,281818,276798,281819,276799,281820,276800,281821,276801,281822,276802,276803,281823,276804,281774,276805,281839,276806,281824,276807,281825,276808,281826,276809,281832,276810,281833,276811,281834,276812,281835,276813,276814,281836,276815,281837,276816,281838,276817,281827,276818,281828,276819,276820,281829,276821,282513,276822,276823,281830,276824,282521,276825,276826,276827,276828,276829,276830,276831,276832,276833,282524,276834,282522,276835,305868,276836,276837,276838,276839,276840,306544,276841,276842,276843,276844,276845,306545,277861,276745,276846,276847,276848,276719,276849,276738,276750,279435,276754,278169,276733,276851,276749,276852,276853,276854,276855,276856,276857,277823,276858,276859,276860,276861,276862,276863,276864,276865,276866,305856,276867,276868,276869,276870,276871,276872,276873,276748,276874,276742,276876,276753,276878,276879,276880,276881,277862,276882,276740,276739,276730,276731,276883,276736,276735,276737,276884,276885,276886,276887,276888,276889,276890,276891,277866,277867,276892,276893,276894,276895,276896,276897,276898,276899,276900,276901,276902,276903,276904,276905,276906,276907,276908,276909,276910,276911,276912,276913,276914,276915,276916,276917,276918,276919,276920,276921,276922,276923,276924,276925,276926,276927,276928,276929,276930,276931,276932,276933,276934,276935,276936,276937,276938,276939,276940,276941,276727,276942,276943,276944,276945,276946,276947,276948,276949,276732,276726,276724,276950,276951,276952,276953,276954,276725,276955,276956,276957,276958,276959,276960,276961,276721,276962,276963,276964,276965,276966,276967,276968,276969,276970,276971,276972,276973,276729,276974,276975,276976,276977,276978,276979,276980,276981,276982,276983,276720,276741,276743,276728,276985,276986,276987,276988,276989,276990,276991,276992,276993,276994,276995,276996,276997,276998,276999,277000,277001,277002,277003,277004,277005,277006,277007,277008,282036,277009,277010,277011,277012,277013,277014,277015,277016,277017,277868,277018,277019,277869,277179,277180,277020,277021,277022,277023,277024,277025,277026,277027,277870,277028,276722,277029,277871,277030,305849,277031,277032,277033,277034,277035,277036,277037,277038,277039,277040,277041,277042,277043,277044,277045,277046,277047,277048,277049,277050,277051,277052,277053,277054,277055,277056,277057,277058,277059,277060,277061,277062,277063,277064,277065,277066,277067,277068,277069,277070,277071,277072,277073,277074,277075,277076,277077,277078,277079,277080,277081,277082,277083,277084,277085,277086,277087,277088,277089,277090,277091,277092,277093,277094,277095,277096,277097,277098,277099,277100,277101,277102,277103,277872,277104,277105,277106,277107,277108,277109,277110,277111,276984,277112,282523,277113,277114,281776,281777,281778,281779,281780,281781,281782,281783,281784,281785,281786,281787,281788,281789,281790,281791,281792,281793,281794,305866,277115,277116,277117,277118,277857,277873,277874,277875,277119,277120,277121,277122,277123,277124,277125,277126,277127,277128,277129,277130,277131,277132,277133,277134,277135,277136,277137,277138,277139,277140,305915,277141,277142,277143,277144,277145,277146,277147,277148,277149,277150,277151,277152,277153,277154,277155,277156,277157,277158,277159,277160,277161,277162,277163,277164,277165,277166,277167,277168,277169,277170,277171,277172,277173,277174,282536,277175,277176,277177,305867,277178}'::integer[])))
Planning time : 44.556 ms
Execution time : 10,998.492 ms