explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yzvr

Settings
# exclusive inclusive rows x rows loops node
1. 2.170 2,022.570 ↓ 3,917.0 3,917 1

Unique (cost=504,471.70..504,471.78 rows=1 width=387) (actual time=2,020.157..2,022.570 rows=3,917 loops=1)

2. 8.438 2,020.400 ↓ 3,917.0 3,917 1

Sort (cost=504,471.70..504,471.71 rows=1 width=387) (actual time=2,020.156..2,020.400 rows=3,917 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,195kB
3. 6.433 2,011.962 ↓ 3,917.0 3,917 1

WindowAgg (cost=504,471.42..504,471.69 rows=1 width=387) (actual time=2,005.168..2,011.962 rows=3,917 loops=1)

4. 6.465 2,005.529 ↓ 3,917.0 3,917 1

Sort (cost=504,471.42..504,471.42 rows=1 width=322) (actual time=2,005.146..2,005.529 rows=3,917 loops=1)

  • Sort Key: ad.bank_account_id, ah.id
  • Sort Method: quicksort Memory: 1,173kB
5. 4.149 1,999.064 ↓ 3,917.0 3,917 1

Nested Loop Left Join (cost=102,566.66..504,471.41 rows=1 width=322) (actual time=798.339..1,999.064 rows=3,917 loops=1)

  • Filter: (rsr.reference_id IS NULL)
6. 6.903 1,979.247 ↓ 3,917.0 3,917 1

Nested Loop Left Join (cost=102,558.07..504,449.66 rows=1 width=322) (actual time=798.300..1,979.247 rows=3,917 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. 4.373 1,958.922 ↓ 4,474.0 4,474 1

Nested Loop (cost=102,557.78..504,448.63 rows=1 width=310) (actual time=798.269..1,958.922 rows=4,474 loops=1)

8. 4.042 1,100.015 ↓ 4,474.0 4,474 1

Nested Loop Left Join (cost=102,557.35..504,444.62 rows=1 width=285) (actual time=797.679..1,100.015 rows=4,474 loops=1)

9. 3.751 1,078.077 ↓ 4,474.0 4,474 1

Nested Loop (cost=102,549.04..504,436.28 rows=1 width=281) (actual time=797.627..1,078.077 rows=4,474 loops=1)

10. 3.884 1,069.852 ↓ 4,474.0 4,474 1

Nested Loop (cost=102,548.90..504,436.12 rows=1 width=167) (actual time=797.577..1,069.852 rows=4,474 loops=1)

11. 77.736 1,052.546 ↓ 4,474.0 4,474 1

Hash Join (cost=102,548.48..504,434.85 rows=1 width=167) (actual time=797.539..1,052.546 rows=4,474 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. 57.030 244.863 ↓ 1.1 11,807 1

Bitmap Heap Scan on ap_headers ah (cost=4,879.39..406,471.19 rows=11,192 width=72) (actual time=23.249..244.863 rows=11,807 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,065
  • Heap Blocks: exact=4,387
13. 0.374 22.451 ↓ 0.0 0 1

BitmapAnd (cost=4,879.39..4,879.39 rows=44,917 width=0) (actual time=22.451..22.451 rows=0 loops=1)

14. 5.947 5.947 ↑ 1.0 58,025 1

Bitmap Index Scan on pk_ap_headers (cost=0.00..1,082.36 rows=58,392 width=0) (actual time=5.947..5.947 rows=58,025 loops=1)

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

Bitmap Index Scan on idx_ap_headers_is_posted (cost=0.00..3,791.18 rows=204,635 width=0) (actual time=16.130..16.130 rows=205,513 loops=1)

  • Index Cond: (is_posted = true)
16.          

SubPlan (for Bitmap Heap Scan)

17. 11.813 165.382 ↓ 0.0 0 11,813

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

18. 0.000 153.569 ↓ 0.0 0 11,813

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

  • One-Time Filter: (ah.cid = 12,975)
19. 32.683 153.569 ↓ 0.0 0 11,813

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

20. 70.878 70.878 ↓ 4.0 4 11,813

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.006 rows=4 loops=11,813)

  • 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. 50.008 50.008 ↓ 0.0 0 50,008

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

  • Index Cond: (id = ad_1.property_id)
  • Filter: ((cid = 12,975) AND (is_disabled = 1))
  • Rows Removed by Filter: 1
22. 69.853 568.803 ↓ 592.2 126,722 1

Hash (cost=26,824.28..26,824.28 rows=214 width=115) (actual time=568.802..568.803 rows=126,722 loops=1)

  • Buckets: 131,072 (originally 1024) Batches: 1 (originally 1) Memory Usage: 18,116kB
23. 36.414 498.950 ↓ 592.2 126,722 1

Nested Loop (cost=4,410.88..26,824.28 rows=214 width=115) (actual time=25.028..498.950 rows=126,722 loops=1)

24. 43.228 289.943 ↓ 223.0 172,593 1

Hash Join (cost=4,410.61..26,592.55 rows=774 width=101) (actual time=24.978..289.943 rows=172,593 loops=1)

  • Hash Cond: (ad.property_id = p.id)
25. 224.682 244.429 ↑ 1.1 173,429 1

Bitmap Heap Scan on ap_details ad (cost=3,971.03..25,657.42 rows=188,699 width=82) (actual time=22.683..244.429 rows=173,429 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,967
26. 19.747 19.747 ↑ 1.0 211,754 1

Bitmap Index Scan on idx_ap_details_cid_property_id (cost=0.00..3,923.86 rows=212,191 width=0) (actual time=19.747..19.747 rows=211,754 loops=1)

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

Hash (cost=439.09..439.09 rows=39 width=23) (actual time=2.286..2.286 rows=598 loops=1)

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

Index Scan using pk_properties on properties p (cost=0.29..439.09 rows=39 width=23) (actual time=0.151..2.148 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.593 172.593 ↑ 1.0 1 172,593

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

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

SubPlan (for Hash Join)

31. 161.144 161.144 ↓ 1.6 210,450 1

Index Scan using idx_ap_details_cid_property_id on ap_details (cost=0.42..70,508.95 rows=132,845 width=4) (actual time=0.161..161.144 rows=210,450 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. 13.422 13.422 ↑ 1.0 1 4,474

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

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

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

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

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

35. 8.948 17.896 ↓ 0.0 0 4,474

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

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

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=4,474)

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

Index Scan using idx_gl_account_trees_gl_account_id on gl_account_trees glat (cost=0.43..3.98 rows=2 width=37) (actual time=0.149..0.191 rows=1 loops=4,474)

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

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

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

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

40. 3.875 15.668 ↓ 0.0 0 3,917

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

41. 3.917 11.751 ↓ 0.0 0 3,917

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

  • 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,011
42. 7.834 7.834 ↓ 0.0 0 3,917

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

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

Bitmap Heap Scan on approval_preferences apr (cost=4.29..9.76 rows=1 width=4) (actual time=0.021..0.021 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.020 0.020 ↑ 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.010..0.010 rows=1 loops=2)

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