explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LPwL

Settings
# exclusive inclusive rows x rows loops node
1. 3.759 1,775.061 ↓ 3,915.0 3,915 1

Unique (cost=451,028.77..451,028.84 rows=1 width=280) (actual time=1,770.839..1,775.061 rows=3,915 loops=1)

2. 11.480 1,771.302 ↓ 3,915.0 3,915 1

Sort (cost=451,028.77..451,028.77 rows=1 width=280) (actual time=1,770.837..1,771.302 rows=3,915 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,194kB
3. 7.284 1,759.822 ↓ 3,915.0 3,915 1

WindowAgg (cost=451,028.48..451,028.76 rows=1 width=280) (actual time=1,752.018..1,759.822 rows=3,915 loops=1)

4. 5.742 1,752.538 ↓ 3,915.0 3,915 1

Sort (cost=451,028.48..451,028.48 rows=1 width=215) (actual time=1,751.996..1,752.538 rows=3,915 loops=1)

  • Sort Key: ad.bank_account_id, ah.id
  • Sort Method: quicksort Memory: 1,172kB
5. 1.799 1,746.796 ↓ 3,915.0 3,915 1

Nested Loop Left Join (cost=106,917.34..451,028.47 rows=1 width=215) (actual time=727.158..1,746.796 rows=3,915 loops=1)

  • Filter: (rsr.reference_id IS NULL)
  • Rows Removed by Filter: 3
6. 2.470 1,729.325 ↓ 3,918.0 3,918 1

Nested Loop Left Join (cost=106,908.75..451,006.72 rows=1 width=215) (actual time=727.125..1,729.325 rows=3,918 loops=1)

7. 5.972 1,711.183 ↓ 3,918.0 3,918 1

Nested Loop Left Join (cost=106,900.43..450,998.37 rows=1 width=215) (actual time=727.103..1,711.183 rows=3,918 loops=1)

  • Filter: ((ap.ap_payee_status_type_id <> 2) OR (ah.lease_customer_id IS NOT NULL))
  • Rows Removed by Filter: 557
8. 2.332 1,696.261 ↓ 4,475.0 4,475 1

Nested Loop (cost=106,900.14..450,997.22 rows=1 width=199) (actual time=727.091..1,696.261 rows=4,475 loops=1)

9. 3.467 960.029 ↓ 4,475.0 4,475 1

Nested Loop (cost=106,899.71..450,993.22 rows=1 width=174) (actual time=726.826..960.029 rows=4,475 loops=1)

10. 1.792 952.087 ↓ 4,475.0 4,475 1

Nested Loop (cost=106,899.57..450,993.07 rows=1 width=167) (actual time=726.817..952.087 rows=4,475 loops=1)

11. 71.863 936.870 ↓ 4,475.0 4,475 1

Hash Join (cost=106,899.16..450,991.64 rows=1 width=167) (actual time=726.800..936.870 rows=4,475 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,484
12. 26.895 209.948 ↓ 1.2 11,808 1

Bitmap Heap Scan on ap_headers ah (cost=9,104.88..352,946.74 rows=9,518 width=72) (actual time=30.250..209.948 rows=11,808 loops=1)

  • Recheck Cond: ((cid = 12,975) AND (ap_header_type_id = 5))
  • Filter: ((NOT is_template) AND is_posted AND (NOT is_template) 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,040
  • Heap Blocks: exact=4,386
13. 0.625 29.471 ↓ 0.0 0 1

BitmapAnd (cost=9,104.88..9,104.88 rows=38,318 width=0) (actual time=29.471..29.471 rows=0 loops=1)

14. 4.148 4.148 ↑ 1.0 58,026 1

Bitmap Index Scan on pk_ap_headers (cost=0.00..1,075.68 rows=58,035 width=0) (actual time=4.148..4.148 rows=58,026 loops=1)

  • Index Cond: (cid = 12,975)
15. 10.498 10.498 ↓ 1.0 205,633 1

Bitmap Index Scan on idx_ap_headers_is_posted (cost=0.00..3,803.51 rows=205,211 width=0) (actual time=10.498..10.498 rows=205,633 loops=1)

  • Index Cond: (is_posted = true)
16. 14.200 14.200 ↓ 1.0 228,650 1

Bitmap Index Scan on idx_ap_headers_ap_header_type_id (cost=0.00..4,218.05 rows=227,951 width=0) (actual time=14.200..14.200 rows=228,650 loops=1)

  • Index Cond: (ap_header_type_id = 5)
17.          

SubPlan (for Bitmap Heap Scan)

18. 0.000 153.582 ↓ 0.0 0 11,814

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

19. 11.814 153.582 ↓ 0.0 0 11,814

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

  • One-Time Filter: (ah.cid = 12,975)
20. 32.689 141.768 ↓ 0.0 0 11,814

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

21. 59.070 59.070 ↓ 4.0 4 11,814

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.004..0.005 rows=4 loops=11,814)

  • 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))
22. 50.009 50.009 ↓ 0.0 0 50,009

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=50,009)

  • Index Cond: (id = ad_1.property_id)
  • Filter: ((cid = 12,975) AND (is_disabled = 1))
  • Rows Removed by Filter: 1
23. 60.515 492.689 ↓ 581.3 126,723 1

Hash (cost=26,916.72..26,916.72 rows=218 width=115) (actual time=492.689..492.689 rows=126,723 loops=1)

  • Buckets: 131,072 (originally 1024) Batches: 1 (originally 1) Memory Usage: 18,116kB
24. 49.707 432.174 ↓ 581.3 126,723 1

Nested Loop (cost=4,459.74..26,916.72 rows=218 width=115) (actual time=18.630..432.174 rows=126,723 loops=1)

25. 44.487 209.873 ↓ 217.6 172,594 1

Hash Join (cost=4,459.46..26,679.32 rows=793 width=101) (actual time=18.612..209.873 rows=172,594 loops=1)

  • Hash Cond: (ad.property_id = p.id)
26. 149.800 163.855 ↑ 1.1 173,430 1

Bitmap Heap Scan on ap_details ad (cost=4,003.80..25,723.79 rows=190,344 width=82) (actual time=17.072..163.855 rows=173,430 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,325
  • Heap Blocks: exact=15,968
27. 14.055 14.055 ↑ 1.0 211,755 1

Bitmap Index Scan on idx_ap_details_cid_property_id (cost=0.00..3,956.22 rows=213,839 width=0) (actual time=14.055..14.055 rows=211,755 loops=1)

  • Index Cond: (cid = 12,975)
28. 0.145 1.531 ↓ 15.3 598 1

Hash (cost=455.17..455.17 rows=39 width=23) (actual time=1.531..1.531 rows=598 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 41kB
29. 1.386 1.386 ↓ 15.3 598 1

Index Scan using pk_properties on properties p (cost=0.29..455.17 rows=39 width=23) (actual time=0.130..1.386 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[])))
30. 172.594 172.594 ↑ 1.0 1 172,594

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,594)

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

SubPlan (for Hash Join)

32. 162.370 162.370 ↓ 1.6 210,451 1

Index Scan using idx_ap_details_cid_property_id on ap_details (cost=0.42..70,534.82 rows=135,567 width=4) (actual time=0.143..162.370 rows=210,451 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
33. 13.425 13.425 ↑ 1.0 1 4,475

Index Scan using pk_ap_remittances on ap_remittances ar (cost=0.42..1.43 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=4,475)

  • Index Cond: ((cid = 12,975) AND (id = ah.ap_remittance_id))
34. 4.475 4.475 ↑ 1.0 1 4,475

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,475)

  • Index Cond: (id = ar.ap_payment_type_id)
35. 733.900 733.900 ↑ 2.0 1 4,475

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.127..0.164 rows=1 loops=4,475)

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

Index Scan using idx_ap_payees_id on ap_payees ap (cost=0.29..1.14 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=4,475)

  • Index Cond: (ah.ap_payee_id = id)
  • Filter: ((cid = 12,975) AND (ah.cid = cid))
  • Rows Removed by Filter: 0
37. 3.918 15.672 ↓ 0.0 0 3,918

Limit (cost=8.32..8.32 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=3,918)

38. 3.918 11.754 ↓ 0.0 0 3,918

Sort (cost=8.32..8.32 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=3,918)

  • Sort Key: fa.id DESC
  • Sort Method: quicksort Memory: 25kB
39. 7.836 7.836 ↓ 0.0 0 3,918

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.002..0.002 rows=0 loops=3,918)

  • Index Cond: ((ah.cid = cid) AND (ah.id = ap_header_id))
  • Filter: (deleted_by IS NULL)
40. 0.000 15.672 ↓ 0.0 0 3,918

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

41. 3.888 15.672 ↓ 0.0 0 3,918

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

42. 3.918 11.754 ↓ 0.0 0 3,918

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

  • 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,012
43. 7.836 7.836 ↓ 0.0 0 3,918

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

  • Index Cond: (reference_id = ah.id)
44. 0.012 0.030 ↑ 1.0 1 3

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

  • Recheck Cond: ((cid = 12,975) AND (route_type_id = 5))
  • Filter: is_enabled
  • Heap Blocks: exact=3
45. 0.018 0.018 ↑ 1.0 2 3

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

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