explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xm7K

Settings
# exclusive inclusive rows x rows loops node
1. 503.078 25,885.234 ↓ 967.2 193,436 1

GroupAggregate (cost=334,978.47..335,121.17 rows=200 width=1,402) (actual time=25,297.283..25,885.234 rows=193,436 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.hide_zero_beginning_balance_for_no_activities_old
2. 6,099.957 25,382.156 ↓ 162.1 198,373 1

Sort (cost=334,978.47..334,981.53 rows=1,224 width=1,370) (actual time=25,297.265..25,382.156 rows=198,373 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.hide_zero_beginning_balance_for_no_activities_old
  • Sort Method: quicksort Memory: 122,693kB
3. 171.523 19,282.199 ↓ 162.1 198,373 1

Subquery Scan on outer_details (cost=334,869.57..334,915.70 rows=1,224 width=1,370) (actual time=18,057.807..19,282.199 rows=198,373 loops=1)

  • Filter: (outer_details.hide_zero_beginning_balance_for_no_activities <> 1)
  • Rows Removed by Filter: 189
4. 964.109 19,110.676 ↓ 161.4 198,562 1

WindowAgg (cost=334,869.57..334,900.32 rows=1,230 width=1,406) (actual time=18,057.804..19,110.676 rows=198,562 loops=1)

5. 1,662.005 18,146.567 ↓ 161.4 198,562 1

Sort (cost=334,869.57..334,872.65 rows=1,230 width=1,362) (actual time=18,057.783..18,146.567 rows=198,562 loops=1)

  • Sort Key: details.property_id, details.grouping_gl_account_id
  • Sort Method: quicksort Memory: 115,088kB
6. 207.863 16,484.562 ↓ 161.4 198,562 1

Subquery Scan on details (cost=1,929.54..334,806.45 rows=1,230 width=1,362) (actual time=2,046.924..16,484.562 rows=198,562 loops=1)

7. 157.427 16,276.699 ↓ 161.4 198,562 1

Append (cost=1,929.54..334,794.15 rows=1,230 width=1,398) (actual time=2,046.922..16,276.699 rows=198,562 loops=1)

8. 232.873 16,115.973 ↓ 171.1 198,266 1

Result (cost=1,929.54..334,678.85 rows=1,159 width=1,384) (actual time=2,046.921..16,115.973 rows=198,266 loops=1)

9. 169.610 15,883.100 ↓ 171.1 198,266 1

Append (cost=1,929.54..334,661.47 rows=1,159 width=1,352) (actual time=2,046.918..15,883.100 rows=198,266 loops=1)

10. 2,759.511 12,815.420 ↓ 2,984.9 167,156 1

Nested Loop Left Join (cost=1,929.54..88,915.51 rows=56 width=648) (actual time=2,046.917..12,815.420 rows=167,156 loops=1)

11. 216.641 9,554.441 ↓ 2,984.9 167,156 1

Hash Left Join (cost=1,929.12..88,742.27 rows=56 width=574) (actual time=2,045.963..9,554.441 rows=167,156 loops=1)

  • Hash Cond: ((art1.cid = ac.cid) AND (art1.ar_code_id = ac.id))
12. 213.377 9,337.694 ↓ 2,984.9 167,156 1

Hash Left Join (cost=1,925.37..88,737.99 rows=56 width=561) (actual time=2,045.849..9,337.694 rows=167,156 loops=1)

  • Hash Cond: (art1.ar_trigger_id = att.id)
13. 256.261 9,124.216 ↓ 2,984.9 167,156 1

Nested Loop Left Join (cost=1,917.43..88,729.90 rows=56 width=547) (actual time=2,045.734..9,124.216 rows=167,156 loops=1)

14. 276.937 8,533.643 ↓ 2,984.9 167,156 1

Nested Loop Left Join (cost=1,917.01..88,690.42 rows=56 width=515) (actual time=2,045.724..8,533.643 rows=167,156 loops=1)

  • Join Filter: (gh.cid = art1.cid)
15. 438.533 7,755.238 ↓ 2,984.9 167,156 1

Nested Loop Left Join (cost=1,916.58..88,634.40 rows=56 width=305) (actual time=2,045.715..7,755.238 rows=167,156 loops=1)

  • Join Filter: (gh.gl_transaction_type_id = ANY ('{7,8,9,17}'::integer[]))
  • Rows Removed by Join Filter: 67,362
16. 320.250 5,979.457 ↓ 2,984.9 167,156 1

Nested Loop Left Join (cost=451.28..6,351.66 rows=56 width=293) (actual time=2,045.690..5,979.457 rows=167,156 loops=1)

  • Join Filter: (gh.gl_transaction_type_id = ANY ('{13,14,18,23,24}'::integer[]))
17. 2,168.966 5,157.739 ↓ 2,984.9 167,156 1

Nested Loop (cost=450.84..6,299.34 rows=56 width=285) (actual time=2,045.670..5,157.739 rows=167,156 loops=1)

  • Join Filter: (gh.gl_transaction_type_id = gtty.id)
  • Rows Removed by Join Filter: 4,346,056
18. 0.116 0.116 ↑ 1.0 27 1

Index Scan using pk_gl_transaction_types on gl_transaction_types gtty (cost=0.14..15.39 rows=27 width=24) (actual time=0.005..0.116 rows=27 loops=1)

19. 1,908.883 2,988.657 ↓ 2,984.9 167,156 27

Materialize (cost=450.71..6,261.42 rows=56 width=265) (actual time=0.066..110.691 rows=167,156 loops=27)

20. 268.934 1,079.774 ↓ 2,984.9 167,156 1

Nested Loop (cost=450.71..6,261.14 rows=56 width=265) (actual time=1.760..1,079.774 rows=167,156 loops=1)

21. 162.751 476.528 ↓ 384.3 167,156 1

Hash Join (cost=450.27..3,196.07 rows=435 width=168) (actual time=1.749..476.528 rows=167,156 loops=1)

  • Hash Cond: (gd.accrual_gl_account_id = gat.gl_account_id)
22. 160.295 312.102 ↓ 258.1 183,498 1

Nested Loop (cost=0.56..2,739.34 rows=711 width=103) (actual time=0.067..312.102 rows=183,498 loops=1)

23. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on load_prop (cost=0.00..1.04 rows=4 width=28) (actual time=0.003..0.007 rows=4 loops=1)

24. 151.800 151.800 ↓ 257.7 45,874 4

Index Scan using idx_gl_details_cid_property_id_post_month on gl_details gd (cost=0.56..682.80 rows=178 width=79) (actual time=0.041..37.950 rows=45,874 loops=4)

  • Index Cond: ((cid = 14,181) AND (property_id = load_prop.property_id) AND (property_id = ANY ('{533403,801783,705098,837894}'::integer[])) AND (post_month >= '2019-01-01'::date) AND (post_month <= '2019-12-01'::date))
  • Filter: (gl_transaction_type_id = ANY ('{13,14,18,23,24,7,8,9,17}'::integer[]))
  • Rows Removed by Filter: 7,821
25. 0.339 1.675 ↑ 1.0 571 1

Hash (cost=442.57..442.57 rows=571 width=77) (actual time=1.674..1.675 rows=571 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 70kB
26. 1.336 1.336 ↑ 1.0 571 1

Seq Scan on gat_temp gat (cost=0.00..442.57 rows=571 width=77) (actual time=0.006..1.336 rows=571 loops=1)

  • Filter: ((cid = 14,181) 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: 26
27. 334.312 334.312 ↑ 1.0 1 167,156

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..7.05 rows=1 width=101) (actual time=0.002..0.002 rows=1 loops=167,156)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((NOT is_template) AND (cid = 14,181) AND (gl_book_id = 103) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
28. 501.468 501.468 ↓ 0.0 0 167,156

Index Scan using pk_ar_allocations on ar_allocations ara (cost=0.43..0.92 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=167,156)

  • Index Cond: ((cid = gh.cid) AND (cid = 14,181) AND (id = gh.reference_id))
29. 501.468 1,337.248 ↑ 1.0 1 167,156

Bitmap Heap Scan on ar_transactions art (cost=1,465.30..1,469.32 rows=1 width=20) (actual time=0.007..0.008 rows=1 loops=167,156)

  • Recheck Cond: (((cid = 14,181) AND (id = gh.reference_id)) OR ((cid = 14,181) AND (id = ara.credit_ar_transaction_id)))
  • Filter: (gh.cid = cid)
  • Heap Blocks: exact=167,392
30. 167.156 835.780 ↓ 0.0 0 167,156

BitmapOr (cost=1,465.30..1,465.30 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=167,156)

31. 501.468 501.468 ↑ 1.0 1 167,156

Bitmap Index Scan on pk_ar_transactions (cost=0.00..0.51 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=167,156)

  • Index Cond: ((cid = 14,181) AND (id = gh.reference_id))
32. 167.156 167.156 ↓ 0.0 0 167,156

Bitmap Index Scan on pk_ar_transactions (cost=0.00..0.50 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=167,156)

  • Index Cond: ((cid = 14,181) AND (id = ara.credit_ar_transaction_id))
33. 501.468 501.468 ↑ 1.0 1 167,156

Index Scan using pk_ar_transactions on ar_transactions art1 (cost=0.43..0.99 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=167,156)

  • Index Cond: ((cid = 14,181) AND (id = COALESCE(ara.charge_ar_transaction_id, art.id)))
34. 334.312 334.312 ↓ 0.0 0 167,156

Index Scan using idx_ar_deposits_id on ar_deposits ad (cost=0.42..0.69 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=167,156)

  • Index Cond: (gh.reference_id = id)
  • Filter: ((cid = 14,181) AND (gh.gl_transaction_type_id = gl_transaction_type_id))
35. 0.045 0.101 ↑ 1.0 86 1

Hash (cost=6.86..6.86 rows=86 width=18) (actual time=0.101..0.101 rows=86 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
36. 0.056 0.056 ↑ 1.0 86 1

Seq Scan on ar_triggers att (cost=0.00..6.86 rows=86 width=18) (actual time=0.006..0.056 rows=86 loops=1)

37. 0.053 0.106 ↑ 1.0 100 1

Hash (cost=2.25..2.25 rows=100 width=25) (actual time=0.106..0.106 rows=100 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
38. 0.053 0.053 ↑ 1.0 100 1

Seq Scan on ar_codes_temp ac (cost=0.00..2.25 rows=100 width=25) (actual time=0.008..0.053 rows=100 loops=1)

  • Filter: (cid = 14,181)
39. 501.468 501.468 ↑ 1.0 1 167,156

Index Scan using pk_cached_leases on cached_leases cl (cost=0.42..2.21 rows=1 width=61) (actual time=0.003..0.003 rows=1 loops=167,156)

  • Index Cond: ((cid = gd.cid) AND (cid = 14,181) AND (id = gd.lease_id))
40. 35.319 2,898.070 ↓ 28.2 31,110 1

Subquery Scan on "*SELECT* 2" (cost=482.80..245,745.40 rows=1,103 width=526) (actual time=2.679..2,898.070 rows=31,110 loops=1)

41. 226.842 2,862.751 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=482.80..245,734.37 rows=1,103 width=526) (actual time=2.676..2,862.751 rows=31,110 loops=1)

42. 55.702 2,573.689 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=482.38..244,464.60 rows=1,103 width=494) (actual time=2.634..2,573.689 rows=31,110 loops=1)

43. 66.973 2,455.767 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=482.09..244,072.54 rows=1,103 width=482) (actual time=2.628..2,455.767 rows=31,110 loops=1)

44. 67.103 2,388.794 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=481.67..243,266.52 rows=1,103 width=477) (actual time=2.611..2,388.794 rows=31,110 loops=1)

45. 38.802 2,290.581 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=481.25..242,460.50 rows=1,103 width=468) (actual time=2.606..2,290.581 rows=31,110 loops=1)

46. 40.318 2,220.669 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=480.82..241,643.12 rows=1,103 width=440) (actual time=2.601..2,220.669 rows=31,110 loops=1)

47. 71.500 2,149.241 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=480.40..240,828.47 rows=1,103 width=432) (actual time=2.596..2,149.241 rows=31,110 loops=1)

48. 64.241 2,015.521 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=479.97..240,277.57 rows=1,103 width=436) (actual time=2.591..2,015.521 rows=31,110 loops=1)

49. 44.095 1,951.280 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=479.54..239,276.79 rows=1,103 width=432) (actual time=2.586..1,951.280 rows=31,110 loops=1)

50. 69.539 1,844.965 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=479.11..238,561.93 rows=1,103 width=392) (actual time=2.580..1,844.965 rows=31,110 loops=1)

51. 39.117 1,775.426 ↓ 28.2 31,110 1

Hash Left Join (cost=478.84..238,219.95 rows=1,103 width=409) (actual time=2.573..1,775.426 rows=31,110 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))
52. 52.445 1,735.542 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=452.14..238,172.57 rows=1,103 width=417) (actual time=1.798..1,735.542 rows=31,110 loops=1)

53. 44.752 1,589.767 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=451.71..235,684.66 rows=1,103 width=369) (actual time=1.793..1,589.767 rows=31,110 loops=1)

54. 51.699 1,482.795 ↓ 28.2 31,110 1

Nested Loop Left Join (cost=451.27..233,193.98 rows=1,103 width=317) (actual time=1.787..1,482.795 rows=31,110 loops=1)

  • Join Filter: (gh_1.gl_transaction_type_id = ANY ('{4,5}'::integer[]))
55. 407.584 1,337.766 ↓ 28.2 31,110 1

Nested Loop (cost=450.84..232,557.13 rows=1,103 width=305) (actual time=1.781..1,337.766 rows=31,110 loops=1)

  • Join Filter: (gh_1.gl_transaction_type_id = gtty_1.id)
  • Rows Removed by Join Filter: 808,860
56. 0.059 0.059 ↑ 1.0 27 1

Index Scan using pk_gl_transaction_types on gl_transaction_types gtty_1 (cost=0.14..15.39 rows=27 width=24) (actual time=0.011..0.059 rows=27 loops=1)

57. 646.649 930.123 ↓ 28.2 31,110 27

Materialize (cost=450.71..232,097.79 rows=1,103 width=281) (actual time=0.062..34.449 rows=31,110 loops=27)

58. 32.947 283.474 ↓ 28.2 31,110 1

Nested Loop (cost=450.71..232,092.27 rows=1,103 width=281) (actual time=1.643..283.474 rows=31,110 loops=1)

59. 31.850 156.705 ↓ 3.7 31,274 1

Hash Join (cost=450.27..209,642.92 rows=8,521 width=184) (actual time=1.625..156.705 rows=31,274 loops=1)

  • Hash Cond: (gd_1.accrual_gl_account_id = gat_1.gl_account_id)
60. 28.894 123.278 ↓ 2.2 31,283 1

Nested Loop (cost=0.56..209,055.79 rows=13,923 width=119) (actual time=0.036..123.278 rows=31,283 loops=1)

61. 0.016 0.016 ↑ 1.0 4 1

Seq Scan on load_prop load_prop_1 (cost=0.00..1.04 rows=4 width=28) (actual time=0.012..0.016 rows=4 loops=1)

62. 94.368 94.368 ↓ 2.2 7,821 4

Index Scan using idx_gl_details_cid_property_id_post_month on gl_details gd_1 (cost=0.56..52,228.88 rows=3,481 width=95) (actual time=0.019..23.592 rows=7,821 loops=4)

  • Index Cond: ((cid = 14,181) AND (property_id = load_prop_1.property_id) AND (post_month >= '2019-01-01'::date) AND (post_month <= '2019-12-01'::date))
  • Filter: (gl_transaction_type_id <> ALL ('{13,14,18,23,24,7,8,9,17}'::integer[]))
  • Rows Removed by Filter: 45,874
63. 0.318 1.577 ↑ 1.0 571 1

Hash (cost=442.57..442.57 rows=571 width=77) (actual time=1.577..1.577 rows=571 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 70kB
64. 1.259 1.259 ↑ 1.0 571 1

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

  • Filter: ((cid = 14,181) 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: 26
65. 93.822 93.822 ↑ 1.0 1 31,274

Index Scan using idx_gl_headers_id on gl_headers gh_1 (cost=0.43..2.63 rows=1 width=101) (actual time=0.003..0.003 rows=1 loops=31,274)

  • Index Cond: (id = gd_1.gl_header_id)
  • Filter: ((is_template IS FALSE) AND (cid = 14,181) AND (gl_book_id = 103) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
  • Rows Removed by Filter: 0
66. 93.330 93.330 ↓ 0.0 0 31,110

Index Scan using pk_ap_allocations on ap_allocations aa (cost=0.43..0.56 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=31,110)

  • Index Cond: ((gh_1.cid = cid) AND (cid = 14,181) AND (gh_1.reference_id = id))
  • Filter: (gl_transaction_type_id = gh_1.gl_transaction_type_id)
67. 62.220 62.220 ↓ 0.0 0 31,110

Index Scan using idx_ap_details on ap_details ad_1 (cost=0.43..2.25 rows=1 width=60) (actual time=0.002..0.002 rows=0 loops=31,110)

  • Index Cond: (aa.credit_ap_detail_id = id)
  • Filter: ((cid = 14,181) AND (aa.cid = cid))
68. 93.330 93.330 ↑ 1.0 1 31,110

Index Scan using idx_ap_details on ap_details ad1 (cost=0.43..2.25 rows=1 width=60) (actual time=0.003..0.003 rows=1 loops=31,110)

  • Index Cond: (id = COALESCE(gd_1.ap_detail_id, aa.charge_ap_detail_id))
  • Filter: (cid = COALESCE(gd_1.cid, aa.cid))
69. 0.386 0.767 ↑ 1.0 789 1

Hash (cost=14.86..14.86 rows=789 width=12) (actual time=0.766..0.767 rows=789 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 44kB
70. 0.381 0.381 ↑ 1.0 789 1

Seq Scan on property_units_temp pu (cost=0.00..14.86 rows=789 width=12) (actual time=0.008..0.381 rows=789 loops=1)

  • Filter: (cid = 14,181)
71. 0.000 0.000 ↓ 0.0 0 31,110

Index Scan using idx_id on property_buildings_temp pb (cost=0.28..0.30 rows=1 width=11) (actual time=0.000..0.000 rows=0 loops=31,110)

  • 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 = 14,181) AND (cid = gd_1.cid))
72. 62.220 62.220 ↓ 0.0 0 31,110

Index Scan using idx_ap_headers on ap_headers ah (cost=0.43..0.64 rows=1 width=60) (actual time=0.002..0.002 rows=0 loops=31,110)

  • Index Cond: (ad_1.ap_header_id = id)
  • Filter: ((ap_financial_status_type_id IS DISTINCT FROM 8) AND (cid = 14,181) AND (ad_1.cid = cid) AND (ad_1.gl_transaction_type_id = gl_transaction_type_id) AND (ad_1.post_month = post_month))
73. 0.000 0.000 ↓ 0.0 0 31,110

Index Scan using idx_ap_headers on ap_headers ah1 (cost=0.43..0.90 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=31,110)

  • Index Cond: (id = aa.lump_ap_header_id)
  • Filter: ((ap_financial_status_type_id IS DISTINCT FROM 8) AND (cid = 14,181) AND (cid = aa.cid))
74. 62.220 62.220 ↑ 1.0 1 31,110

Index Scan using idx_ap_headers on ap_headers ah2 (cost=0.43..0.49 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=31,110)

  • Index Cond: (ad1.ap_header_id = id)
  • Filter: ((ap_financial_status_type_id IS DISTINCT FROM 8) AND (ad1.cid = cid) AND (ad1.gl_transaction_type_id = gl_transaction_type_id) AND (ad1.post_month = post_month))
  • Rows Removed by Filter: 0
75. 31.110 31.110 ↓ 0.0 0 31,110

Index Scan using idx_lease_customers_id on lease_customers lc (cost=0.42..0.73 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=31,110)

  • Index Cond: (id = COALESCE(ah2.lease_customer_id, ah.lease_customer_id))
  • Filter: (cid = COALESCE(ah2.cid, ah.cid))
  • Rows Removed by Filter: 0
76. 31.110 31.110 ↓ 0.0 0 31,110

Index Scan using idx_customers_id on customers cust (cost=0.43..0.73 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=31,110)

  • Index Cond: (id = lc.customer_id)
  • Filter: (cid = lc.cid)
  • Rows Removed by Filter: 0
77. 31.110 31.110 ↓ 0.0 0 31,110

Index Scan using idx_ap_payments_id on ap_payments ap_ref (cost=0.42..0.72 rows=1 width=17) (actual time=0.001..0.001 rows=0 loops=31,110)

  • Index Cond: (id = ah.ap_payment_id)
  • Filter: ((cid = 14,181) AND (cid = ah.cid))
78. 0.000 0.000 ↓ 0.0 0 31,110

Index Scan using idx_ap_payments_id on ap_payments ap (cost=0.42..0.72 rows=1 width=17) (actual time=0.000..0.000 rows=0 loops=31,110)

  • Index Cond: (id = ah1.ap_payment_id)
  • Filter: ((cid = 14,181) AND (cid = ah1.cid))
79. 62.220 62.220 ↑ 1.0 1 31,110

Index Scan using idx_ap_payees_id on ap_payees app (cost=0.29..0.35 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=31,110)

  • Index Cond: (id = COALESCE(ah.ap_payee_id, ah2.ap_payee_id))
  • Filter: (cid = COALESCE(ah.cid, ah2.cid))
80. 62.220 62.220 ↓ 0.0 0 31,110

Index Scan using idx_ar_deposits_id on ar_deposits ad_2 (cost=0.42..0.44 rows=1 width=29) (actual time=0.002..0.002 rows=0 loops=31,110)

  • Index Cond: (gh_1.reference_id = id)
  • Filter: ((cid = 14,181) AND (gh_1.gl_transaction_type_id = gl_transaction_type_id))
81. 0.309 3.299 ↓ 4.2 296 1

Subquery Scan on "*SELECT* 3" (cost=112.63..115.29 rows=71 width=587) (actual time=2.728..3.299 rows=296 loops=1)

82. 0.614 2.990 ↓ 4.2 296 1

HashAggregate (cost=112.63..114.05 rows=71 width=503) (actual time=2.725..2.990 rows=296 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
83. 0.287 2.376 ↓ 4.2 296 1

Hash Join (cost=73.32..110.68 rows=71 width=99) (actual time=0.240..2.376 rows=296 loops=1)

  • Hash Cond: (p.id = load_prop_2.property_id)
84. 0.577 2.073 ↓ 11.8 296 1

Nested Loop (cost=72.23..109.49 rows=25 width=103) (actual time=0.210..2.073 rows=296 loops=1)

85. 0.286 0.608 ↓ 11.4 296 1

Hash Join (cost=71.95..78.43 rows=26 width=46) (actual time=0.196..0.608 rows=296 loops=1)

  • Hash Cond: (bbt.property_id = p.id)
86. 0.141 0.141 ↑ 1.0 296 1

Seq Scan on beg_bal_temp bbt (cost=0.00..5.70 rows=296 width=16) (actual time=0.008..0.141 rows=296 loops=1)

  • Filter: (cid = 14,181)
87. 0.056 0.181 ↑ 1.0 102 1

Hash (cost=70.68..70.68 rows=102 width=34) (actual time=0.181..0.181 rows=102 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
88. 0.109 0.125 ↑ 1.0 102 1

Bitmap Heap Scan on properties p (cost=5.07..70.68 rows=102 width=34) (actual time=0.030..0.125 rows=102 loops=1)

  • Recheck Cond: (cid = 14,181)
  • Heap Blocks: exact=27
89. 0.016 0.016 ↑ 1.0 102 1

Bitmap Index Scan on idx_properties_cid_id_is_disabled_remote_primary_key (cost=0.00..5.04 rows=102 width=0) (actual time=0.016..0.016 rows=102 loops=1)

  • Index Cond: (cid = 14,181)
90. 0.888 0.888 ↑ 1.0 1 296

Index Scan using idx_temp_gat_gl_account_id on gat_temp gat_2 (cost=0.28..1.18 rows=1 width=73) (actual time=0.003..0.003 rows=1 loops=296)

  • Index Cond: (gl_account_id = bbt.gl_account_id)
  • Filter: ((cid = 14,181) 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[])))
91. 0.005 0.016 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.015..0.016 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
92. 0.011 0.011 ↑ 1.0 4 1

Seq Scan on load_prop load_prop_2 (cost=0.00..1.04 rows=4 width=4) (actual time=0.008..0.011 rows=4 loops=1)