explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XNgW

Settings
# exclusive inclusive rows x rows loops node
1. 2.080 2,266.768 ↓ 3,908.0 3,908 1

Unique (cost=500,311.03..500,311.11 rows=1 width=280) (actual time=2,264.459..2,266.768 rows=3,908 loops=1)

2. 8.302 2,264.688 ↓ 3,908.0 3,908 1

Sort (cost=500,311.03..500,311.04 rows=1 width=280) (actual time=2,264.457..2,264.688 rows=3,908 loops=1)

  • Sort Key: ah.header_number, ad.id, ad.ap_header_id, ad.ap_transaction_type_id, ad.transaction_amount, ad.pre_approval_amount, ad.retention_amount, ad.bank_account_id, ad.ap_export_batch_id, ad.exported_by, ad.exported_on, ((ad.transaction_amount - COALESCE(ad.pre_approval_amount, '0'::numeric))), (sum((ad.transaction_amount - COALESCE(ad.pre_approval_amount, '0'::numeric))) OVER (?)), (CASE WHEN (ah.lease_customer_id IS NULL) THEN ap.company_name ELSE func_format_refund_customer_names(ah.header_memo, false) END), p.id, p.property_name, ad.gl_account_id, glat.name, glat.formatted_account_number, ba.account_name, ad.description, ah.due_date, ah.post_date, ap.ap_payee_status_type_id, ah.lease_customer_id, ah.ap_header_sub_type_id, ah.retention_released_on, apt.name, (CASE WHEN (fa.ap_header_id IS NOT NULL) THEN 1 ELSE 0 END)
  • Sort Method: quicksort Memory: 1,138kB
3. 6.322 2,256.386 ↓ 3,908.0 3,908 1

WindowAgg (cost=500,310.74..500,311.02 rows=1 width=280) (actual time=2,249.727..2,256.386 rows=3,908 loops=1)

4. 6.396 2,250.064 ↓ 3,908.0 3,908 1

Sort (cost=500,310.74..500,310.75 rows=1 width=215) (actual time=2,249.704..2,250.064 rows=3,908 loops=1)

  • Sort Key: ad.bank_account_id, ah.id
  • Sort Method: quicksort Memory: 1,139kB
5. 2.475 2,243.668 ↓ 3,908.0 3,908 1

Nested Loop Left Join (cost=102,488.24..500,310.73 rows=1 width=215) (actual time=926.524..2,243.668 rows=3,908 loops=1)

  • Filter: (rsr.reference_id IS NULL)
6. 5.894 2,190.389 ↓ 3,908.0 3,908 1

Nested Loop Left Join (cost=102,479.65..500,288.99 rows=1 width=215) (actual time=925.799..2,190.389 rows=3,908 loops=1)

  • Filter: ((ap.ap_payee_status_type_id = ANY ('{1,3}'::integer[])) OR (ah.lease_customer_id IS NOT NULL))
  • Rows Removed by Filter: 557
7. 3.878 2,171.100 ↓ 4,465.0 4,465 1

Nested Loop (cost=102,479.36..500,287.96 rows=1 width=203) (actual time=925.767..2,171.100 rows=4,465 loops=1)

8. 4.550 1,238.502 ↓ 4,465.0 4,465 1

Nested Loop Left Join (cost=102,478.93..500,283.97 rows=1 width=178) (actual time=923.344..1,238.502 rows=4,465 loops=1)

9. 3.627 1,202.697 ↓ 4,465.0 4,465 1

Nested Loop (cost=102,470.62..500,275.62 rows=1 width=174) (actual time=922.795..1,202.697 rows=4,465 loops=1)

10. 4.646 1,194.605 ↓ 4,465.0 4,465 1

Nested Loop (cost=102,470.48..500,275.47 rows=1 width=167) (actual time=922.779..1,194.605 rows=4,465 loops=1)

11. 76.832 1,172.099 ↓ 4,465.0 4,465 1

Hash Join (cost=102,470.06..500,274.18 rows=1 width=167) (actual time=921.857..1,172.099 rows=4,465 loops=1)

  • Hash Cond: ((ah.id = ad.ap_header_id) AND (ah.gl_transaction_type_id = ad.gl_transaction_type_id) AND (ah.post_month = ad.post_month))
  • Join Filter: (CASE WHEN ((17 = ah.ap_header_sub_type_id) AND (ah.retention_released_on IS NULL)) THEN ((ad.transaction_amount - COALESCE((ad.pre_approval_amount + ad.retention_amount), '0'::numeric)) <> '0'::numeric) ELSE ((ad.transaction_amount - COALESCE(ad.pre_approval_amount, '0'::numeric)) <> '0'::numeric) END AND CASE WHEN (ah.lease_customer_id IS NOT NULL) THEN (ad.property_id = ANY ('{242805,242809,618893,257851,647053,647051,647077,647079,647098,647103,647108,253130,577863,584467,577872,584466,639442,639434,268278,268279,893277,691469,352490,667756,972013,972012,556038,687243,630377,774558,504241,259609,642284,628858,351447,269278,523307,351342,640965,264648,348858,262517,253951,262503,252459,259168,267250,264628,258505,254896,259828,257693,259841,225260,662357,630548,695032,258638,512075,267988,839176,822502,511404,267999,326516,352487,253709,601794,359617,359619,359618,254524,268095,268592,572775,572777,572776,352797,352799,352798,508190,709379,709392,556037,491249,653627,484383,637763,571996,571998,571997,550553,584940,331875,254698,329446,329576,329577,329579,329648,329575,331558,331872,329647,331563,329580,331870,331562,331559,330677,331565,329578,330642,331555,331561,329494,337128,584946,584947,488393,254742,863306,515829,621540,609827,359747,484365,484367,484366,531352,723802,482524,225755,258628,258631,258633,258635,584693,584694,584705,584706,688819,516367,577965,497438,497432,497861,497864,508593,586785,254695,496808,496810,496809,505862,326332,593765,505191,505193,505192,325896,631034,862405,560687,484394,484396,484395,250608,359486,359488,359487,602120,637751,1062880,353600,269266,646255,508081,353118,695110,695036,801900,801901,801905,225227,577926,337072,505285,577927,253242,628778,628780,628782,1064267,515017,582827,249056,351549,630416,630414,249095,556465,556466,511155,557900,328609,329566,329228,329350,328626,329273,325079,556467,488407,488409,489610,488408,553895,267924,493178,493177,493174,493179,496813,640748,252323,577928,269161,599150,508184,630294,508107,640350,497616,508187,497618,577886,613191,608386,572271,497620,640348,532993,576861,532979,618930,486215,560691,560693,560692,1034278,490262,490264,490263,326353,486218,268677,326325,527220,538934,527221,542053,527222,599210,225254,225256,225242,236963,225329,327017,508340,508339,580717,580719,580718,545851,545853,558033,593997,545852,491254,577867,577869,577868,490638,578753,249091,325902,1057519,296861,578466,628921,628923,628922,254699,496550,609828,351548,497222,253620,680096,529315,545898,334388,649275,714191,519080,226452,496526,671038,556461,496520,230590,325886,225758,325884,529304,709248,269273,577871,519342,263638,483398,550500,889099,533135,533137,533136,235474,267993,264633,241533,242812,519258,337112,337115,325026,324535,258615,239000,539073,631004,631121,643479,496524,325021,539023,533229,504640,325023,545838,267238,496522,334371,231341,504523,502805,225748,225745,553566,557885,557887,560912,560940,560944,560915,551060,1015715,494340,494347,353606,353608,353607,497287,258643,359636,519233,505484,505486,505485,1057510,1057512,357465,351334,484400,359516,580730,352359,267962,486200,337034,353597,268568,348840,264630,328634,259832,269276,329757,254382,497232,521776,520639,529351,232188,844798,525632,522241,524970,523272,524968,603198,227616,249071,243905,511729,513968,511731,511730,261760,577833,572006,572007,572008,572009,572010,628718,622819,262499,773282,331557,550704,531351,582360,1037274,260370,259122,573345,511159,643276,589974,599254,599255,599256,599257,589975,589976,589977,653628,246489,599487,504663,507149,507150,584629,584631,584630,645906,504764,528536,528522,253239,564100,605344,518976,503574,512314,711846,788456,508499,505795,536078,628927,511219,233227,249035,633039,633038,1057293,633153,505150,628929,324540,520621,530740,523280,517436,531307,578459,226922,645904,225236,557892,253123,242803,1057522,621538,514295,614450,605297,519603,519399,489807,551078,546757,649214,522433,593957,593969,589888,601819,598125,601821,601822,598121,587518,761330,530748,530750,530749,493176,493175,511154,231344,225228,640967,325294,773280,242823,650526,650528,757520,757522,757523,511250,647112,647121,647124,325479,326481,505151,505200,353621,504533,259836,268465,260091,334382,553711,257620,324531,324525,324530,253695,296999,269279,577922,334390,325481,613188,254433,524914,553710,254697,326333,296995,296996,269159,269491,326326,268588,238400,591571,593584,254696,267987,269478,329755,269486,268591,269158,269488,232177,232165,603224,254692,584285,249219,540275,676391,589865,589867,589866,626634,626638,229303,241013,560929}'::integer[])) ELSE (hashed SubPlan 2) END)
  • Rows Removed by Join Filter: 45,474
12. 42.603 248.161 ↓ 1.1 11,791 1

Bitmap Heap Scan on ap_headers ah (cost=4,889.08..402,399.52 rows=11,158 width=72) (actual time=29.698..248.161 rows=11,791 loops=1)

  • Recheck Cond: (cid = 12,975)
  • Filter: ((NOT is_template) AND is_posted AND (reversal_ap_header_id IS NULL) AND (ap_payment_id IS NULL) AND (COALESCE(ap_financial_status_type_id, 0) <> 8) AND (ap_header_sub_type_id = ANY ('{5,6,7,8,17,12}'::integer[])) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 10,055
  • Heap Blocks: exact=4,396
13. 0.385 28.603 ↓ 0.0 0 1

BitmapAnd (cost=4,889.08..4,889.08 rows=44,454 width=0) (actual time=28.603..28.603 rows=0 loops=1)

14. 7.341 7.341 ↓ 1.0 57,683 1

Bitmap Index Scan on pk_ap_headers (cost=0.00..1,061.62 rows=57,227 width=0) (actual time=7.341..7.341 rows=57,683 loops=1)

  • Index Cond: (cid = 12,975)
15. 20.877 20.877 ↑ 1.0 204,745 1

Bitmap Index Scan on idx_ap_headers_is_posted (cost=0.00..3,821.62 rows=206,027 width=0) (actual time=20.876..20.877 rows=204,745 loops=1)

  • Index Cond: (is_posted = true)
16.          

SubPlan (for Bitmap Heap Scan)

17. 0.000 176.955 ↓ 0.0 0 11,797

Unique (cost=0.71..16.77 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=11,797)

18. 0.000 176.955 ↓ 0.0 0 11,797

Result (cost=0.71..16.77 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=11,797)

  • One-Time Filter: (ah.cid = 12,975)
19. 44.387 176.955 ↓ 0.0 0 11,797

Nested Loop (cost=0.71..16.77 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=11,797)

20. 82.579 82.579 ↓ 4.0 4 11,797

Index Scan using idx_ap_details_cid_ap_header_id_gl_transaction_type_id_pm on ap_details ad_1 (cost=0.42..8.45 rows=1 width=12) (actual time=0.005..0.007 rows=4 loops=11,797)

  • Index Cond: ((cid = 12,975) AND (ap_header_id = ah.id) AND (gl_transaction_type_id = ah.gl_transaction_type_id) AND (post_month = ah.post_month))
21. 49.989 49.989 ↓ 0.0 0 49,989

Index Scan using idx_properties_id on properties p_1 (cost=0.29..8.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=49,989)

  • Index Cond: (id = ad_1.property_id)
  • Filter: ((cid = 12,975) AND (is_disabled = 1))
  • Rows Removed by Filter: 1
22. 69.277 690.857 ↓ 605.9 126,630 1

Hash (cost=26,705.59..26,705.59 rows=209 width=115) (actual time=690.857..690.857 rows=126,630 loops=1)

  • Buckets: 131,072 (originally 1024) Batches: 1 (originally 1) Memory Usage: 18,104kB
23. 46.598 621.580 ↓ 605.9 126,630 1

Nested Loop (cost=4,391.88..26,705.59 rows=209 width=115) (actual time=28.111..621.580 rows=126,630 loops=1)

24. 45.370 402.882 ↓ 226.1 172,100 1

Hash Join (cost=4,391.60..26,477.74 rows=761 width=101) (actual time=28.068..402.882 rows=172,100 loops=1)

  • Hash Cond: (ad.property_id = p.id)
25. 332.295 355.161 ↑ 1.1 172,936 1

Bitmap Heap Scan on ap_details ad (cost=3,926.47..25,522.45 rows=186,644 width=82) (actual time=25.708..355.161 rows=172,936 loops=1)

  • Recheck Cond: (cid = 12,975)
  • Filter: ((reversal_ap_detail_id IS NULL) AND (deleted_by IS NULL) AND (deleted_on IS NULL))
  • Rows Removed by Filter: 38,301
  • Heap Blocks: exact=15,856
26. 22.866 22.866 ↓ 1.0 211,237 1

Bitmap Index Scan on idx_ap_details_cid_property_id (cost=0.00..3,879.81 rows=209,518 width=0) (actual time=22.866..22.866 rows=211,237 loops=1)

  • Index Cond: (cid = 12,975)
27. 0.146 2.351 ↓ 15.3 598 1

Hash (cost=464.64..464.64 rows=39 width=23) (actual time=2.351..2.351 rows=598 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 41kB
28. 2.205 2.205 ↓ 15.3 598 1

Index Scan using pk_properties on properties p (cost=0.29..464.64 rows=39 width=23) (actual time=0.169..2.205 rows=598 loops=1)

  • Index Cond: ((cid = 12,975) AND (id = ANY ('{242805,242809,618893,257851,647053,647051,647077,647079,647098,647103,647108,253130,577863,584467,577872,584466,639442,639434,268278,268279,893277,691469,352490,667756,972013,972012,556038,687243,630377,774558,504241,259609,642284,628858,351447,269278,523307,351342,640965,264648,348858,262517,253951,262503,252459,259168,267250,264628,258505,254896,259828,257693,259841,225260,662357,630548,695032,258638,512075,267988,839176,822502,511404,267999,326516,352487,253709,601794,359617,359619,359618,254524,268095,268592,572775,572777,572776,352797,352799,352798,508190,709379,709392,556037,491249,653627,484383,637763,571996,571998,571997,550553,584940,331875,254698,329446,329576,329577,329579,329648,329575,331558,331872,329647,331563,329580,331870,331562,331559,330677,331565,329578,330642,331555,331561,329494,337128,584946,584947,488393,254742,863306,515829,621540,609827,359747,484365,484367,484366,531352,723802,482524,225755,258628,258631,258633,258635,584693,584694,584705,584706,688819,516367,577965,497438,497432,497861,497864,508593,586785,254695,496808,496810,496809,505862,326332,593765,505191,505193,505192,325896,631034,862405,560687,484394,484396,484395,250608,359486,359488,359487,602120,637751,1062880,353600,269266,646255,508081,353118,695110,695036,801900,801901,801905,225227,577926,337072,505285,577927,253242,628778,628780,628782,1064267,515017,582827,249056,351549,630416,630414,249095,556465,556466,511155,557900,328609,329566,329228,329350,328626,329273,325079,556467,488407,488409,489610,488408,553895,267924,493178,493177,493174,493179,496813,640748,252323,577928,269161,599150,508184,630294,508107,640350,497616,508187,497618,577886,613191,608386,572271,497620,640348,532993,576861,532979,618930,486215,560691,560693,560692,1034278,490262,490264,490263,326353,486218,268677,326325,527220,538934,527221,542053,527222,599210,225254,225256,225242,236963,225329,327017,508340,508339,580717,580719,580718,545851,545853,558033,593997,545852,491254,577867,577869,577868,490638,578753,249091,325902,1057519,296861,578466,628921,628923,628922,254699,496550,609828,351548,497222,253620,680096,529315,545898,334388,649275,714191,519080,226452,496526,671038,556461,496520,230590,325886,225758,325884,529304,709248,269273,577871,519342,263638,483398,550500,889099,533135,533137,533136,235474,267993,264633,241533,242812,519258,337112,337115,325026,324535,258615,239000,539073,631004,631121,643479,496524,325021,539023,533229,504640,325023,545838,267238,496522,334371,231341,504523,502805,225748,225745,553566,557885,557887,560912,560940,560944,560915,551060,1015715,494340,494347,353606,353608,353607,497287,258643,359636,519233,505484,505486,505485,1057510,1057512,357465,351334,484400,359516,580730,352359,267962,486200,337034,353597,268568,348840,264630,328634,259832,269276,329757,254382,497232,521776,520639,529351,232188,844798,525632,522241,524970,523272,524968,603198,227616,249071,243905,511729,513968,511731,511730,261760,577833,572006,572007,572008,572009,572010,628718,622819,262499,773282,331557,550704,531351,582360,1037274,260370,259122,573345,511159,643276,589974,599254,599255,599256,599257,589975,589976,589977,653628,246489,599487,504663,507149,507150,584629,584631,584630,645906,504764,528536,528522,253239,564100,605344,518976,503574,512314,711846,788456,508499,505795,536078,628927,511219,233227,249035,633039,633038,1057293,633153,505150,628929,324540,520621,530740,523280,517436,531307,578459,226922,645904,225236,557892,253123,242803,1057522,621538,514295,614450,605297,519603,519399,489807,551078,546757,649214,522433,593957,593969,589888,601819,598125,601821,601822,598121,587518,761330,530748,530750,530749,493176,493175,511154,231344,225228,640967,325294,773280,242823,650526,650528,757520,757522,757523,511250,647112,647121,647124,325479,326481,505151,505200,353621,504533,259836,268465,260091,334382,553711,257620,324531,324525,324530,253695,296999,269279,577922,334390,325481,613188,254433,524914,553710,254697,326333,296995,296996,269159,269491,326326,268588,238400,591571,593584,254696,267987,269478,329755,269486,268591,269158,269488,232177,232165,603224,254692,584285,249219,540275,676391,589865,589867,589866,626634,626638,229303,241013,560929}'::integer[])))
29. 172.100 172.100 ↑ 1.0 1 172,100

Index Scan using idx_bank_accounts on bank_accounts ba (cost=0.28..0.30 rows=1 width=22) (actual time=0.001..0.001 rows=1 loops=172,100)

  • Index Cond: (id = ad.bank_account_id)
  • Filter: (cid = 12,975)
30.          

SubPlan (for Hash Join)

31. 156.249 156.249 ↓ 1.6 209,933 1

Index Scan using idx_ap_details_cid_property_id on ap_details (cost=0.42..70,547.47 rows=129,710 width=4) (actual time=0.156..156.249 rows=209,933 loops=1)

  • Index Cond: ((cid = 12,975) AND (property_id = ANY ('{242805,242809,618893,257851,647053,647051,647077,647079,647098,647103,647108,253130,577863,584467,577872,584466,639442,639434,268278,268279,893277,691469,352490,667756,972013,972012,556038,687243,630377,774558,504241,259609,642284,628858,351447,269278,523307,351342,640965,264648,348858,262517,253951,262503,252459,259168,267250,264628,258505,254896,259828,257693,259841,225260,662357,630548,695032,258638,512075,267988,839176,822502,511404,267999,326516,352487,253709,601794,359617,359619,359618,254524,268095,268592,572775,572777,572776,352797,352799,352798,508190,709379,709392,556037,491249,653627,484383,637763,571996,571998,571997,550553,584940,331875,254698,329446,329576,329577,329579,329648,329575,331558,331872,329647,331563,329580,331870,331562,331559,330677,331565,329578,330642,331555,331561,329494,337128,584946,584947,488393,254742,863306,515829,621540,609827,359747,484365,484367,484366,531352,723802,482524,225755,258628,258631,258633,258635,584693,584694,584705,584706,688819,516367,577965,497438,497432,497861,497864,508593,586785,254695,496808,496810,496809,505862,326332,593765,505191,505193,505192,325896,631034,862405,560687,484394,484396,484395,250608,359486,359488,359487,602120,637751,1062880,353600,269266,646255,508081,353118,695110,695036,801900,801901,801905,225227,577926,337072,505285,577927,253242,628778,628780,628782,1064267,515017,582827,249056,351549,630416,630414,249095,556465,556466,511155,557900,328609,329566,329228,329350,328626,329273,325079,556467,488407,488409,489610,488408,553895,267924,493178,493177,493174,493179,496813,640748,252323,577928,269161,599150,508184,630294,508107,640350,497616,508187,497618,577886,613191,608386,572271,497620,640348,532993,576861,532979,618930,486215,560691,560693,560692,1034278,490262,490264,490263,326353,486218,268677,326325,527220,538934,527221,542053,527222,599210,225254,225256,225242,236963,225329,327017,508340,508339,580717,580719,580718,545851,545853,558033,593997,545852,491254,577867,577869,577868,490638,578753,249091,325902,1057519,296861,578466,628921,628923,628922,254699,496550,609828,351548,497222,253620,680096,529315,545898,334388,649275,714191,519080,226452,496526,671038,556461,496520,230590,325886,225758,325884,529304,709248,269273,577871,519342,263638,483398,550500,889099,533135,533137,533136,235474,267993,264633,241533,242812,519258,337112,337115,325026,324535,258615,239000,539073,631004,631121,643479,496524,325021,539023,533229,504640,325023,545838,267238,496522,334371,231341,504523,502805,225748,225745,553566,557885,557887,560912,560940,560944,560915,551060,1015715,494340,494347,353606,353608,353607,497287,258643,359636,519233,505484,505486,505485,1057510,1057512,357465,351334,484400,359516,580730,352359,267962,486200,337034,353597,268568,348840,264630,328634,259832,269276,329757,254382,497232,521776,520639,529351,232188,844798,525632,522241,524970,523272,524968,603198,227616,249071,243905,511729,513968,511731,511730,261760,577833,572006,572007,572008,572009,572010,628718,622819,262499,773282,331557,550704,531351,582360,1037274,260370,259122,573345,511159,643276,589974,599254,599255,599256,599257,589975,589976,589977,653628,246489,599487,504663,507149,507150,584629,584631,584630,645906,504764,528536,528522,253239,564100,605344,518976,503574,512314,711846,788456,508499,505795,536078,628927,511219,233227,249035,633039,633038,1057293,633153,505150,628929,324540,520621,530740,523280,517436,531307,578459,226922,645904,225236,557892,253123,242803,1057522,621538,514295,614450,605297,519603,519399,489807,551078,546757,649214,522433,593957,593969,589888,601819,598125,601821,601822,598121,587518,761330,530748,530750,530749,493176,493175,511154,231344,225228,640967,325294,773280,242823,650526,650528,757520,757522,757523,511250,647112,647121,647124,325479,326481,505151,505200,353621,504533,259836,268465,260091,334382,553711,257620,324531,324525,324530,253695,296999,269279,577922,334390,325481,613188,254433,524914,553710,254697,326333,296995,296996,269159,269491,326326,268588,238400,591571,593584,254696,267987,269478,329755,269486,268591,269158,269488,232177,232165,603224,254692,584285,249219,540275,676391,589865,589867,589866,626634,626638,229303,241013,560929}'::integer[])))
  • Filter: ((deleted_by IS NULL) AND (deleted_on IS NULL))
  • Rows Removed by Filter: 454
32. 17.860 17.860 ↑ 1.0 1 4,465

Index Scan using pk_ap_remittances on ap_remittances ar (cost=0.42..1.28 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=4,465)

  • Index Cond: ((cid = 12,975) AND (id = ah.ap_remittance_id))
33. 4.465 4.465 ↑ 1.0 1 4,465

Index Scan using pk_ap_payment_types on ap_payment_types apt (cost=0.14..0.15 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=4,465)

  • Index Cond: (id = ar.ap_payment_type_id)
34. 0.000 31.255 ↓ 0.0 0 4,465

Limit (cost=8.32..8.32 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=4,465)

35. 8.930 31.255 ↓ 0.0 0 4,465

Sort (cost=8.32..8.32 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=4,465)

  • Sort Key: fa.id DESC
  • Sort Method: quicksort Memory: 25kB
36. 22.325 22.325 ↓ 0.0 0 4,465

Index Scan using idx_file_associations_ap_header_id_partial on file_associations fa (cost=0.29..8.31 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=4,465)

  • Index Cond: ((ah.cid = cid) AND (ah.id = ap_header_id))
  • Filter: (deleted_by IS NULL)
37. 928.720 928.720 ↑ 2.0 1 4,465

Index Scan using idx_gl_account_trees_gl_account_id on gl_account_trees glat (cost=0.43..3.97 rows=2 width=37) (actual time=0.163..0.208 rows=1 loops=4,465)

  • Index Cond: (gl_account_id = ad.gl_account_id)
  • Filter: ((cid = 12,975) AND (is_default = 1))
  • Rows Removed by Filter: 291
38. 13.395 13.395 ↑ 1.0 1 4,465

Index Scan using idx_ap_payees_id on ap_payees ap (cost=0.29..1.02 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=4,465)

  • Index Cond: (ah.ap_payee_id = id)
  • Filter: ((cid = 12,975) AND (ah.cid = cid))
  • Rows Removed by Filter: 0
39. 0.000 50.804 ↓ 0.0 0 3,908

Unique (cost=8.59..21.73 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=3,908)

40. 3.886 50.804 ↓ 0.0 0 3,908

Nested Loop (cost=8.59..21.73 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=3,908)

41. 35.172 46.896 ↓ 0.0 0 3,908

Bitmap Heap Scan on rule_stop_results rsr (cost=4.30..11.96 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=3,908)

  • Recheck Cond: (reference_id = ah.id)
  • Filter: ((NOT is_archived) AND (cid = 12,975) AND (route_type_id = 5) AND (rule_stop_status_type_id = 1))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=1,004
42. 11.724 11.724 ↓ 0.0 0 3,908

Bitmap Index Scan on idx_rule_stop_results_reference_id (cost=0.00..4.30 rows=2 width=0) (actual time=0.003..0.003 rows=0 loops=3,908)

  • Index Cond: (reference_id = ah.id)
43. 0.006 0.022 ↓ 0.0 0 2

Bitmap Heap Scan on approval_preferences apr (cost=4.29..9.76 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=2)

  • Recheck Cond: ((cid = 12,975) AND (route_type_id = 5))
  • Filter: is_enabled
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=2
44. 0.016 0.016 ↑ 2.0 1 2

Bitmap Index Scan on uk_cid_route_type_id (cost=0.00..4.29 rows=2 width=0) (actual time=0.008..0.008 rows=1 loops=2)

  • Index Cond: ((cid = 12,975) AND (route_type_id = 5))