explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HDsT

Settings
# exclusive inclusive rows x rows loops node
1. 2.065 2,479.153 ↓ 3,915.0 3,915 1

Unique (cost=503,086.36..503,086.44 rows=1 width=280) (actual time=2,476.842..2,479.153 rows=3,915 loops=1)

2. 7.410 2,477.088 ↓ 3,915.0 3,915 1

Sort (cost=503,086.36..503,086.36 rows=1 width=280) (actual time=2,476.842..2,477.088 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. 5.575 2,469.678 ↓ 3,915.0 3,915 1

WindowAgg (cost=503,086.07..503,086.35 rows=1 width=280) (actual time=2,463.758..2,469.678 rows=3,915 loops=1)

4. 5.476 2,464.103 ↓ 3,915.0 3,915 1

Sort (cost=503,086.07..503,086.08 rows=1 width=215) (actual time=2,463.732..2,464.103 rows=3,915 loops=1)

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

Nested Loop Left Join (cost=102,697.46..503,086.06 rows=1 width=215) (actual time=836.220..2,458.627 rows=3,915 loops=1)

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

Nested Loop (cost=102,688.87..503,064.31 rows=1 width=215) (actual time=835.257..2,406.522 rows=3,918 loops=1)

7. 2.946 1,227.454 ↓ 3,918.0 3,918 1

Nested Loop Left Join (cost=102,688.44..503,060.32 rows=1 width=190) (actual time=833.713..1,227.454 rows=3,918 loops=1)

8. 2.170 1,204.918 ↓ 3,918.0 3,918 1

Nested Loop Left Join (cost=102,680.12..503,051.97 rows=1 width=190) (actual time=833.459..1,204.918 rows=3,918 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
9. 3.748 1,180.373 ↓ 4,475.0 4,475 1

Nested Loop (cost=102,679.83..503,050.94 rows=1 width=174) (actual time=833.423..1,180.373 rows=4,475 loops=1)

10. 2.526 1,172.150 ↓ 4,475.0 4,475 1

Nested Loop (cost=102,679.70..503,050.78 rows=1 width=167) (actual time=833.411..1,172.150 rows=4,475 loops=1)

11. 74.517 1,133.824 ↓ 4,475.0 4,475 1

Hash Join (cost=102,679.28..503,049.50 rows=1 width=167) (actual time=832.757..1,133.824 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. 81.103 288.822 ↓ 1.1 11,808 1

Bitmap Heap Scan on ap_headers ah (cost=4,885.01..404,962.26 rows=11,131 width=72) (actual time=19.842..288.822 rows=11,808 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,388
13. 0.292 18.695 ↓ 0.0 0 1

BitmapAnd (cost=4,885.01..4,885.01 rows=44,743 width=0) (actual time=18.695..18.695 rows=0 loops=1)

14. 4.757 4.757 ↑ 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.757..4.757 rows=58,026 loops=1)

  • Index Cond: (cid = 12,975)
15. 13.646 13.646 ↓ 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=13.646..13.646 rows=205,633 loops=1)

  • Index Cond: (is_posted = true)
16.          

SubPlan (for Bitmap Heap Scan)

17. 0.000 189.024 ↓ 0.0 0 11,814

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

18. 11.814 189.024 ↓ 0.0 0 11,814

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

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

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

20. 94.512 94.512 ↓ 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.006..0.008 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))
21. 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
22. 57.708 607.672 ↓ 581.3 126,723 1

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

  • Buckets: 131,072 (originally 1024) Batches: 1 (originally 1) Memory Usage: 18,388kB
23. 43.821 549.964 ↓ 581.3 126,723 1

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

24. 45.003 333.549 ↓ 217.6 172,594 1

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

  • Hash Cond: (ad.property_id = p.id)
25. 272.719 287.224 ↑ 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.237..287.224 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
26. 14.505 14.505 ↑ 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.505..14.505 rows=211,755 loops=1)

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

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

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

Index Scan using pk_properties on properties p (cost=0.29..455.17 rows=39 width=23) (actual time=0.144..1.213 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.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)
30.          

SubPlan (for Hash Join)

31. 162.813 162.813 ↓ 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.141..162.813 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
32. 35.800 35.800 ↑ 1.0 1 4,475

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

  • Index Cond: ((cid = 12,975) AND (id = ah.ap_remittance_id))
33. 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)
34. 22.375 22.375 ↑ 1.0 1 4,475

Index Scan using idx_ap_payees_id on ap_payees ap (cost=0.29..1.02 rows=1 width=28) (actual time=0.005..0.005 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
35. 0.000 19.590 ↓ 0.0 0 3,918

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

36. 7.836 19.590 ↓ 0.0 0 3,918

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

  • Sort Key: fa.id DESC
  • Sort Method: quicksort Memory: 25kB
37. 11.754 11.754 ↓ 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.003..0.003 rows=0 loops=3,918)

  • Index Cond: ((ah.cid = cid) AND (ah.id = ap_header_id))
  • Filter: (deleted_by IS NULL)
38. 1,175.400 1,175.400 ↑ 2.0 1 3,918

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.237..0.300 rows=1 loops=3,918)

  • Index Cond: (gl_account_id = ad.gl_account_id)
  • Filter: ((cid = 12,975) AND (is_default = 1))
  • Rows Removed by Filter: 291
39. 3.918 50.934 ↓ 0.0 0 3,918

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

40. 3.591 47.016 ↓ 0.0 0 3,918

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

41. 27.426 43.098 ↓ 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.011..0.011 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
42. 15.672 15.672 ↓ 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.004..0.004 rows=0 loops=3,918)

  • Index Cond: (reference_id = ah.id)
43. 0.294 0.327 ↑ 1.0 1 3

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

  • Recheck Cond: ((cid = 12,975) AND (route_type_id = 5))
  • Filter: is_enabled
  • Heap Blocks: exact=3
44. 0.033 0.033 ↑ 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.011..0.011 rows=2 loops=3)

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