explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IRRo

Settings
# exclusive inclusive rows x rows loops node
1. 218.945 11,027.119 ↓ 445.2 97,052 1

GroupAggregate (cost=2,500,094.72..2,500,376.03 rows=218 width=1,586) (actual time=10,800.739..11,027.119 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,884.080 10,808.174 ↓ 45.2 98,123 1

Sort (cost=2,500,094.72..2,500,100.15 rows=2,172 width=1,554) (actual time=10,800.721..10,808.174 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. 23.060 7,924.094 ↓ 45.2 98,123 1

Subquery Scan on outer_details (cost=2,499,777.87..2,499,974.34 rows=2,172 width=1,554) (actual time=7,567.345..7,924.094 rows=98,123 loops=1)

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

WindowAgg (cost=2,499,777.87..2,499,903.40 rows=2,183 width=1,590) (actual time=7,567.342..7,901.034 rows=98,206 loops=1)

5. 704.746 7,574.482 ↓ 45.0 98,206 1

Sort (cost=2,499,777.87..2,499,783.33 rows=2,183 width=1,362) (actual time=7,567.322..7,574.482 rows=98,206 loops=1)

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

WindowAgg (cost=2,499,569.48..2,499,656.80 rows=2,183 width=1,362) (actual time=6,567.537..6,869.736 rows=98,206 loops=1)

7. 379.349 6,576.446 ↓ 45.0 98,206 1

Sort (cost=2,499,569.48..2,499,574.94 rows=2,183 width=1,354) (actual time=6,567.525..6,576.446 rows=98,206 loops=1)

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

Subquery Scan on details (cost=1,846.82..2,499,448.41 rows=2,183 width=1,354) (actual time=3.010..6,197.097 rows=98,206 loops=1)

9. 10.092 6,165.661 ↓ 45.0 98,206 1

Append (cost=1,846.82..2,499,382.92 rows=2,183 width=1,390) (actual time=3.008..6,165.661 rows=98,206 loops=1)

10. 47.379 6,153.849 ↓ 53.6 97,840 1

Result (cost=1,846.82..2,498,847.58 rows=1,827 width=1,376) (actual time=3.008..6,153.849 rows=97,840 loops=1)

11. 10.723 6,106.470 ↓ 53.6 97,840 1

Append (cost=1,846.82..2,498,788.21 rows=1,827 width=1,348) (actual time=3.005..6,106.470 rows=97,840 loops=1)

12. 1,306.969 5,813.543 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,846.82..2,492,745.28 rows=1,760 width=644) (actual time=3.005..5,813.543 rows=91,372 loops=1)

13. 38.073 4,415.202 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,846.52..2,490,107.21 rows=1,760 width=594) (actual time=1.347..4,415.202 rows=91,372 loops=1)

14. 18.824 4,011.641 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=1,846.10..2,487,822.57 rows=1,760 width=543) (actual time=1.333..4,011.641 rows=91,372 loops=1)

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

Nested Loop Left Join (cost=1,845.13..2,478,239.46 rows=1,760 width=306) (actual time=1.303..1,434.401 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. 104.914 850.501 ↓ 51.9 91,372 1

Nested Loop Left Join (cost=470.75..57,429.54 rows=1,760 width=294) (actual time=1.281..850.501 rows=91,372 loops=1)

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

Hash Join (cost=470.31..56,016.18 rows=1,760 width=286) (actual time=1.269..562.843 rows=91,372 loops=1)

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

Nested Loop (cost=466.62..56,005.84 rows=1,760 width=266) (actual time=1.243..526.074 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. 86.794 503.116 ↓ 51.9 91,372 1

Nested Loop (cost=466.62..55,952.01 rows=1,760 width=242) (actual time=1.237..503.116 rows=91,372 loops=1)

21. 31.927 142.206 ↓ 6.2 91,372 1

Hash Join (cost=466.19..23,061.62 rows=14,787 width=145) (actual time=1.217..142.206 rows=91,372 loops=1)

  • Hash Cond: (gd.accrual_gl_account_id = gat.gl_account_id)
22. 109.107 109.107 ↓ 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.038..109.107 rows=91,982 loops=1)

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

Hash (cost=447.07..447.07 rows=571 width=73) (actual time=1.172..1.172 rows=571 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 68kB
24. 1.034 1.034 ↑ 1.0 571 1

Seq Scan on gat_temp gat (cost=0.00..447.07 rows=571 width=73) (actual time=0.010..1.034 rows=571 loops=1)

  • Filter: (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.006 0.020 ↑ 1.0 27 1

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

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

Seq Scan on gl_transaction_types gtty (cost=0.00..2.81 rows=27 width=24) (actual time=0.005..0.014 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. 182.744 2,558.416 ↑ 1.0 1 91,372

Nested Loop Left Join (cost=0.97..5.41 rows=1 width=249) (actual time=0.018..0.028 rows=1 loops=91,372)

34. 1,187.836 2,284.300 ↑ 1.0 1 91,372

Hash Right Join (cost=0.83..5.23 rows=1 width=235) (actual time=0.016..0.025 rows=1 loops=91,372)

  • Hash Cond: (ac.id = art1.ar_code_id)
35. 730.976 730.976 ↑ 1.0 100 91,372

Seq Scan on ar_codes_temp ac (cost=0.00..4.00 rows=100 width=21) (actual time=0.002..0.008 rows=100 loops=91,372)

36. 0.000 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. 365.488 365.488 ↑ 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.004 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.296 282.204 ↓ 96.5 6,468 1

Subquery Scan on *SELECT* 2 (cost=569.94..5,990.13 rows=67 width=522) (actual time=2.127..282.204 rows=6,468 loops=1)

42. 37.774 279.908 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=569.94..5,988.12 rows=67 width=522) (actual time=2.125..279.908 rows=6,468 loops=1)

43. 4.021 229.198 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=569.52..5,907.79 rows=67 width=484) (actual time=2.075..229.198 rows=6,468 loops=1)

44. 1.654 225.177 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=569.10..5,863.56 rows=67 width=479) (actual time=2.070..225.177 rows=6,468 loops=1)

45. 4.853 210.587 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=568.68..5,819.33 rows=67 width=470) (actual time=2.056..210.587 rows=6,468 loops=1)

46. 5.546 205.734 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=568.25..5,776.25 rows=67 width=441) (actual time=2.052..205.734 rows=6,468 loops=1)

47. 2.584 200.188 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=567.83..5,729.02 rows=67 width=433) (actual time=2.046..200.188 rows=6,468 loops=1)

48. 4.081 178.200 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=567.40..5,693.91 rows=67 width=437) (actual time=2.030..178.200 rows=6,468 loops=1)

49. 5.612 174.119 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=566.97..5,640.48 rows=67 width=433) (actual time=2.025..174.119 rows=6,468 loops=1)

50. 2.925 162.039 ↓ 96.5 6,468 1

Hash Left Join (cost=566.54..5,598.72 rows=67 width=393) (actual time=2.000..162.039 rows=6,468 loops=1)

  • Hash Cond: (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 = pb.id)
51. 2.833 158.906 ↓ 96.5 6,468 1

Hash Left Join (cost=519.54..5,549.38 rows=67 width=406) (actual time=1.785..158.906 rows=6,468 loops=1)

  • Hash Cond: (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. 5.218 155.894 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=471.61..5,499.09 rows=67 width=414) (actual time=1.598..155.894 rows=6,468 loops=1)

53. 6.395 131.272 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=471.17..5,404.20 rows=67 width=370) (actual time=1.581..131.272 rows=6,468 loops=1)

54. 2.755 118.409 ↓ 96.5 6,468 1

Nested Loop Left Join (cost=470.74..5,324.13 rows=67 width=318) (actual time=1.563..118.409 rows=6,468 loops=1)

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

Hash Join (cost=470.31..5,286.43 rows=67 width=306) (actual time=1.543..96.250 rows=6,468 loops=1)

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

Nested Loop (cost=466.62..5,282.51 rows=67 width=282) (actual time=1.514..93.485 rows=6,468 loops=1)

57. 2.878 63.095 ↓ 11.5 6,488 1

Hash Join (cost=466.19..4,425.63 rows=566 width=185) (actual time=1.479..63.095 rows=6,488 loops=1)

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

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

59. 0.004 0.004 ↑ 1.0 1 1

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

60. 57.733 57.733 ↓ 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.088..57.733 rows=6,490 loops=1)

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

Hash (cost=447.07..447.07 rows=571 width=73) (actual time=1.374..1.375 rows=571 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 68kB
62. 1.244 1.244 ↑ 1.0 571 1

Seq Scan on gat_temp gat_1 (cost=0.00..447.07 rows=571 width=73) (actual time=0.011..1.244 rows=571 loops=1)

  • Filter: (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.006 0.020 ↑ 1.0 27 1

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

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

66. 19.404 19.404 ↓ 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.003..0.003 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.087 0.179 ↑ 1.0 703 1

Hash (cost=25.09..25.09 rows=703 width=8) (actual time=0.179..0.179 rows=703 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 38kB
70. 0.092 0.092 ↑ 1.0 703 1

Seq Scan on property_units_temp pu (cost=0.00..25.09 rows=703 width=8) (actual time=0.009..0.092 rows=703 loops=1)

71. 0.117 0.208 ↑ 1.0 688 1

Hash (cost=24.64..24.64 rows=688 width=7) (actual time=0.208..0.208 rows=688 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
72. 0.091 0.091 ↑ 1.0 688 1

Seq Scan on property_buildings_temp pb (cost=0.00..24.64 rows=688 width=7) (actual time=0.007..0.091 rows=688 loops=1)

73. 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))
74. 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))
75. 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))
76. 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)))
77. 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
78. 12.936 12.936 ↓ 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.002..0.002 rows=0 loops=6,468)

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

Subquery Scan on *SELECT* 3 (cost=509.53..535.34 rows=356 width=579) (actual time=1.424..1.720 rows=366 loops=1)

82. 0.411 1.588 ↓ 1.0 366 1

HashAggregate (cost=509.53..521.99 rows=356 width=495) (actual time=1.421..1.588 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
83. 0.049 1.177 ↓ 1.0 367 1

Nested Loop (cost=26.21..501.52 rows=356 width=101) (actual time=0.145..1.177 rows=367 loops=1)

  • Join Filter: (load_prop_2.property_id = bbt.property_id)
84. 0.002 0.015 ↑ 1.0 1 1

Nested Loop (cost=0.28..3.41 rows=1 width=34) (actual time=0.014..0.015 rows=1 loops=1)

85. 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.005..0.006 rows=1 loops=1)

86. 0.007 0.007 ↑ 1.0 1 1

Index Scan using idx_properties_id on properties p (cost=0.28..2.32 rows=1 width=30) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (id = load_prop_2.property_id)
  • Filter: (cid = 14181)
87. 0.126 1.113 ↓ 1.0 367 1

Hash Join (cost=25.94..486.54 rows=356 width=75) (actual time=0.128..1.113 rows=367 loops=1)

  • Hash Cond: (gat_2.gl_account_id = bbt.gl_account_id)
88. 0.877 0.877 ↑ 1.0 571 1

Seq Scan on gat_temp gat_2 (cost=0.00..447.07 rows=571 width=69) (actual time=0.008..0.877 rows=571 loops=1)

  • Filter: (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
89. 0.054 0.110 ↑ 1.0 367 1

Hash (cost=14.01..14.01 rows=367 width=14) (actual time=0.109..0.110 rows=367 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
90. 0.056 0.056 ↑ 1.0 367 1

Seq Scan on beg_bal_temp bbt (cost=0.00..14.01 rows=367 width=14) (actual time=0.008..0.056 rows=367 loops=1)

Planning time : 26.740 ms
Execution time : 11,035.281 ms