explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CdBkw

Settings
# exclusive inclusive rows x rows loops node
1. 245.352 9,314.659 ↓ 445.2 97,052 1

GroupAggregate (cost=2,500,784.09..2,501,065.40 rows=218 width=1,586) (actual time=9,060.336..9,314.659 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. 1,944.560 9,069.307 ↓ 45.2 98,123 1

Sort (cost=2,500,784.09..2,500,789.52 rows=2,172 width=1,554) (actual time=9,060.313..9,069.307 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.411 7,124.747 ↓ 45.2 98,123 1

Subquery Scan on outer_details (cost=2,500,467.24..2,500,663.71 rows=2,172 width=1,554) (actual time=6,923.262..7,124.747 rows=98,123 loops=1)

  • Filter: (outer_details.hide_zero_beginning_balance_for_no_activities <> 1)
  • Rows Removed by Filter: 83
4. 169.997 7,100.336 ↓ 45.0 98,206 1

WindowAgg (cost=2,500,467.24..2,500,592.76 rows=2,183 width=1,590) (actual time=6,923.259..7,100.336 rows=98,206 loops=1)

5. 178.736 6,930.339 ↓ 45.0 98,206 1

Sort (cost=2,500,467.24..2,500,472.70 rows=2,183 width=1,362) (actual time=6,923.240..6,930.339 rows=98,206 loops=1)

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

WindowAgg (cost=2,500,258.85..2,500,346.17 rows=2,183 width=1,362) (actual time=6,619.475..6,751.603 rows=98,206 loops=1)

7. 204.089 6,626.034 ↓ 45.0 98,206 1

Sort (cost=2,500,258.85..2,500,264.31 rows=2,183 width=1,354) (actual time=6,619.463..6,626.034 rows=98,206 loops=1)

  • Sort Key: details.property_id, details.grouping_gl_account_id
  • Sort Method: quicksort Memory: 56974kB
8. 29.859 6,421.945 ↓ 45.0 98,206 1

Subquery Scan on details (cost=1,848.29..2,500,137.78 rows=2,183 width=1,354) (actual time=9.268..6,421.945 rows=98,206 loops=1)

9. 10.707 6,392.086 ↓ 45.0 98,206 1

Append (cost=1,848.29..2,500,072.29 rows=2,183 width=1,390) (actual time=9.265..6,392.086 rows=98,206 loops=1)

10. 45.436 6,379.518 ↓ 53.6 97,840 1

Result (cost=1,848.29..2,499,932.81 rows=1,827 width=1,376) (actual time=9.265..6,379.518 rows=97,840 loops=1)

11. 9.737 6,334.082 ↓ 53.6 97,840 1

Append (cost=1,848.29..2,499,873.43 rows=1,827 width=1,348) (actual time=9.261..6,334.082 rows=97,840 loops=1)

12. 1,227.964 6,066.903 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,848.29..2,493,851.16 rows=1,760 width=644) (actual time=9.261..6,066.903 rows=91,372 loops=1)

13. 13.046 4,747.567 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,848.00..2,491,213.09 rows=1,760 width=594) (actual time=2.164..4,747.567 rows=91,372 loops=1)

14. 58.905 4,369.033 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,847.58..2,488,928.45 rows=1,760 width=543) (actual time=2.146..4,369.033 rows=91,372 loops=1)

  • Join Filter: (gh.cid = art1.cid)
15. 100.350 1,386.224 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,846.60..2,478,240.94 rows=1,760 width=306) (actual time=2.094..1,386.224 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. 69.965 829.014 ↓ 51.9 91,372 1

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

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

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

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

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

19. 0.005 0.005 ↑ 1.0 1 1

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

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

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

21. 31.342 170.819 ↓ 6.2 91,372 1

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

  • Hash Cond: (gd.accrual_gl_account_id = gat.gl_account_id)
22. 137.541 137.541 ↓ 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.048..137.541 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.154 1.936 ↑ 1.0 571 1

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

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

Seq Scan on gat_temp gat (cost=0.00..448.54 rows=571 width=77) (actual time=0.008..1.782 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. 274.116 274.116 ↑ 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.003..0.003 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.007 0.023 ↑ 1.0 27 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
27. 0.016 0.016 ↑ 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.016 rows=27 loops=1)

28. 182.744 182.744 ↓ 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.002..0.002 rows=0 loops=91,372)

  • Index Cond: ((cid = gh.cid) AND (cid = 14181) AND (id = gh.reference_id))
29. 182.744 456.860 ↑ 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.005..0.005 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 274.116 ↓ 0.0 0 91,372

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

31. 182.744 182.744 ↑ 1.0 1 91,372

Bitmap Index Scan on pk_ar_transactions (cost=0.00..0.49 rows=1 width=0) (actual time=0.002..0.002 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. 91.372 2,923.904 ↑ 1.0 1 91,372

Nested Loop Left Join (cost=0.97..6.04 rows=1 width=249) (actual time=0.020..0.032 rows=1 loops=91,372)

34. 1,279.208 2,741.160 ↑ 1.0 1 91,372

Hash Right Join (cost=0.83..5.86 rows=1 width=235) (actual time=0.018..0.030 rows=1 loops=91,372)

  • Hash Cond: ((ac.cid = art1.cid) AND (ac.id = art1.ar_code_id))
35. 1,096.464 1,096.464 ↑ 1.0 100 91,372

Seq Scan on ar_codes_temp ac (cost=0.00..4.25 rows=100 width=25) (actual time=0.002..0.012 rows=100 loops=91,372)

  • Filter: (cid = 14181)
36. 91.372 365.488 ↑ 1.0 1 91,372

Hash (cost=0.79..0.79 rows=1 width=218) (actual time=0.004..0.004 rows=1 loops=91,372)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
37. 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)))
38. 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)
39. 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))
40. 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))
41. 2.155 257.442 ↓ 96.5 6,468 1

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

42. 30.303 255.287 ↓ 96.5 6,468 1

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

43. 3.923 212.048 ↓ 96.5 6,468 1

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

44. 3.806 208.125 ↓ 96.5 6,468 1

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

45. 4.915 197.851 ↓ 96.5 6,468 1

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

46. 5.162 192.936 ↓ 96.5 6,468 1

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

47. 1.456 187.774 ↓ 96.5 6,468 1

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

48. 3.712 166.914 ↓ 96.5 6,468 1

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

49. 4.341 163.202 ↓ 96.5 6,468 1

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

50. 4.688 152.393 ↓ 96.5 6,468 1

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

51. 3.317 147.705 ↓ 96.5 6,468 1

Hash Left Join (cost=524.53..5,554.61 rows=67 width=410) (actual time=2.418..147.705 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))
52. 4.436 144.056 ↓ 96.5 6,468 1

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

53. 5.630 120.216 ↓ 96.5 6,468 1

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

54. 4.646 108.118 ↓ 96.5 6,468 1

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

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

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

  • Hash Cond: (gh_1.gl_transaction_type_id = gtty_1.id)
56. 2.727 88.068 ↓ 96.5 6,468 1

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

57. 2.659 59.389 ↓ 11.5 6,488 1

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

  • Hash Cond: (gd_1.accrual_gl_account_id = gat_1.gl_account_id)
58. 1.184 54.937 ↓ 7.3 6,490 1

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

59. 0.005 0.005 ↑ 1.0 1 1

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

60. 53.748 53.748 ↓ 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.107..53.748 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
61. 0.230 1.793 ↑ 1.0 571 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 70kB
62. 1.563 1.563 ↑ 1.0 571 1

Seq Scan on gat_temp gat_1 (cost=0.00..448.54 rows=571 width=77) (actual time=0.012..1.563 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
63. 25.952 25.952 ↑ 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.004..0.004 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
64. 0.010 0.028 ↑ 1.0 27 1

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

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

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

66. 12.936 12.936 ↓ 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.002..0.002 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)
67. 6.468 6.468 ↓ 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.001..0.001 rows=0 loops=6,468)

  • Index Cond: (aa.credit_ap_detail_id = id)
  • Filter: ((cid = 14181) AND (aa.cid = cid))
68. 19.404 19.404 ↑ 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.003..0.003 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))
69. 0.168 0.332 ↑ 1.0 703 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
70. 0.164 0.164 ↑ 1.0 703 1

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

  • Filter: (cid = 14181)
71. 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))
72. 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))
73. 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))
74. 19.404 19.404 ↑ 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.003..0.003 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))
75. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=6,468)

  • Index Cond: ((cid = COALESCE(ah2.cid, ah.cid)) AND (id = COALESCE(ah2.lease_customer_id, ah.lease_customer_id)))
76. 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
77. 6.468 6.468 ↓ 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.001..0.001 rows=0 loops=6,468)

  • Index Cond: (id = ah.ap_payment_id)
  • Filter: ((cid = 14181) AND (cid = ah.cid))
78. 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))
79. 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))
80. 0.129 1.861 ↓ 1.0 366 1

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

81. 0.420 1.732 ↓ 1.0 366 1

HashAggregate (cost=113.68..126.14 rows=356 width=495) (actual time=1.570..1.732 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
82. 0.056 1.312 ↓ 1.0 367 1

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

  • Join Filter: (p.id = load_prop_2.property_id)
83. 0.005 0.005 ↑ 1.0 1 1

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

84. 0.226 1.251 ↓ 17.5 367 1

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

85. 0.104 0.291 ↓ 16.7 367 1

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

  • Hash Cond: (bbt.property_id = p.id)
86. 0.049 0.049 ↑ 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.049 rows=367 loops=1)

  • Filter: (cid = 14181)
87. 0.015 0.138 ↑ 1.0 66 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
88. 0.123 0.123 ↑ 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.012..0.123 rows=66 loops=1)

  • Index Cond: (cid = 14181)
89. 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 : 55.907 ms
Execution time : 9,325.796 ms