%3CLINGO-SUB%20id%3D%22lingo-sub-1421960%22%20slang%3D%22en-US%22%3EOptimally%20tuning%20your%20workload%20on%20Azure%20Database%20for%20MySQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1421960%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20aria-level%3D%221%22%20id%3D%22toc-hId--1328669231%22%20id%3D%22toc-hId--1328669231%22%20id%3D%22toc-hId--1328669231%22%20id%3D%22toc-hId--1328669231%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EOverview%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWhen%20troubleshooting%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EAzure%20Database%20for%20MySQL%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eperformance%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eit%20can%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eoften%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bbe%20hard%20to%20know%20which%20server%20parameters%20you%20need%20to%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eadjust%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWe%20used%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EGeneral%20Purpose%202%20vCore%20and%204%20vCore%20MySQL%20servers%20with%20a%20workload%20that%20consisted%20of%20~90%25%20read%20queries%20across%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E150%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econcurrent%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bconnections%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bas%20our%20test%20environment%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20data-contrast%3D%22auto%22%3ETh%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ee%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Brecommendations%20and%20insights%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebelow%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ewere%20generated%20and%20tested%20specifically%20on%20Azure%20Database%20for%20MySQL%20instances.%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A120%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20aria-level%3D%223%22%20id%3D%22toc-hId--638107757%22%20id%3D%22toc-hId--638107757%22%20id%3D%22toc-hId--638107757%22%20id%3D%22toc-hId--638107757%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ESymptom%201%3A%20Queries%20exceed%20temporary%20table%20sizing%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIn%20h%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eigh%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eread%20scenario%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Es%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eat%20times%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Equeries%20executed%20against%20the%20server%20c%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ean%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eexceed%20the%20in-memory%20temporary%20table%20sizes.%26nbsp%3B%20If%20your%20workload%20exceed%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Es%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20default%20size%20of%20temporary%20table%20sizes%2C%20then%20the%20MySQL%20server%20will%20switch%20to%20writing%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20temporary%20tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bto%20disk%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20which%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecan%20affect%20server%20performance.%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESo%20how%20do%20you%20know%20if%20your%20server%20is%20writing%20to%20disk%20because%20of%20exceeding%20temporary%20table%20size%3F%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A120%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ELet's%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etake%20a%20look%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bat%20our%20metrics%2C%20specifically%20for%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_disk_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'%20and%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A80%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eshow%20global%20status%20like%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_disk_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A187%2C%26quot%3B335559739%26quot%3B%3A80%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CPRE%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eshow%20global%20status%20like%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A180%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIf%20the%20server%20creates%20the%20table%20on%20disk%20either%20initially%20or%20by%20converting%20an%20in-memory%20table%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bit%20will%20increment%20the%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_disk_tables'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bstatus%20variable.%26nbsp%3B%20Similarly%2C%20quer%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eies%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eperform%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eing%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20join%20or%20sort%20without%20the%20benefit%20of%20an%20index%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Brequire%20the%20creation%20of%20a%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etemporary%20table%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ein%20memory%2C%20which%20will%20increment%20the%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecreated_tmp_tables'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bvariable.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A120%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3ENote%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3ETo%20determine%20if%20running%20a%20specific%20query%20will%20use%20temporary%20tables%2C%20run%20an%20explain%20on%20the%20query.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%20detail%20in%20the%20'extra'%20column%20indicate%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Es%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B'Using%20temporary'%20if%20the%20query%20will%20run%20using%20temporary%20tables.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A120%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3ETo%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecalculate%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3Bthe%20percentage%20of%20your%20workload%20with%20queries%20spilling%20to%20disks%2C%20use%20your%20metric%20values%20in%20the%20formula%20below%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A80%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20data-contrast%3D%22auto%22%3E(%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ECreated%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E_tmp_disk_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%2F%20(%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ECreated_tmp_disk_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%2B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ECreated_tmp_tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E)%20)%20*%20100%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A180%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EIdeally%2C%20this%20percentage%20should%20be%20less%2025%25.%20If%20you%20see%20that%20the%20percentage%20is%2025%25%20or%20greater%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Eyou%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3Bcan%20modify%20two%20server%20parameters%2C%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etmp_table_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3Band%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Emax_heap_table_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ETo%20calculate%20the%20values%20required%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Elook%20at%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethe%20total%20per-connection%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bmemory%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bvalues%20and%20the%20base%20memory%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3Bsum%20of%20per-connection%20memory%20parameters%2C%20excluding%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etmp_table_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Ecombined%20with%20the%20base%20memory%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Eaccounts%20for%20total%20memory%20of%20the%20server.%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%20formula%20to%20calculate%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Ethe%20largest%20possible%20size%20of%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etmp_table_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Eand%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Emax_heap_table_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3Eis%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A120%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20data-contrast%3D%22auto%22%3E(total%20memory%20-%20(base%20memory%20%2B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E(%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esum%20of%20per-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econnection%20memory%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B*%20%23%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econnections%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E)%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E)%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%2F%20%23%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econnections%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A180%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20aria-level%3D%221%22%20id%3D%22toc-hId-1849405076%22%20id%3D%22toc-hId-1849405076%22%20id%3D%22toc-hId-1849405076%22%20id%3D%22toc-hId-1849405076%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ESymptom%202%3A%20Heavy%20contention%20for%20tables%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A120%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIf%20a%20user%20is%20running%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eseveral%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Equeries%20against%20tables%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20caus%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eing%20the%20number%20of%20opened%20tables%20to%20increase%20and%20potential%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ely%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bheavy%20contention%20on%20the%20same%20table%2C%20then%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Equer%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ey%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eperformance%20can%20be%20impacted.%26nbsp%3B%20This%20is%20particularly%20true%20for%20a%20heavy%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eread%20scenario%20in%20which%20different%20tables%20are%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econcurrently%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebeing%20opened%20by%20many%20connections.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EYou%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ec%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ean%20monitor%20table%20open%20trends%20by%20looking%20at%20the%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eopened_tables'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Emetric%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ELet's%20also%20look%20at%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethe%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bparameter%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20which%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eis%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20total%20number%20of%20open%20tables%20allowed%20for%20all%20threads%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20data-contrast%3D%22auto%22%3EBased%20on%20our%20performance%20testing%2C%20a%20heavy%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eread%20scenario%20can%20benefit%20from%20tuning%20this%20parameter.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ETo%20optimize%20the%20value%20of%20the%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eparameter%2C%20c%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eonfigure%20it%20so%20that%20approximately%2050%25%20of%20its%20value%20is%20being%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eused%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bby%20the%20workload.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EYou%20can%20c%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ealculate%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthis%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Efairly%20easily%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eusing%20the%20following%20formula%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20data-contrast%3D%22auto%22%3EMinimum%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3D%20(total%20%23%20of%20tables)%20x%20(%23%20of%20active%20connections)%20%2F%202%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A180%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIt%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%E2%80%99%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Es%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ealso%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eimportant%2C%20however%2C%20to%20include%20the%20base%20tables%20within%20this%20calculation.%20For%20example%2C%20for%20150%20active%20connections%20with%20around%20250%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etables%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etotal%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethe%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eparameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eshould%20be%20at%20least%2018%2C750.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESimilarly%2C%20for%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache_instances'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20increase%20the%20value%20if%20a%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esingle%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eexperiencing%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20lot%20of%20heavy%20contentions%20of%20queries%20against%20it.%26nbsp%3B%20For%20150%20active%20connections%20and%20250%20total%20tables%2C%20we%20found%20a%20benefit%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eby%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bincreasing%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etable_open_cache_instances'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bfrom%201%20to%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E4%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20especially%20while%20testing%20a%20high%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eread%20scenario.%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20aria-level%3D%221%22%20id%3D%22toc-hId-41950613%22%20id%3D%22toc-hId-41950613%22%20id%3D%22toc-hId-41950613%22%20id%3D%22toc-hId-41950613%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ESymptom%203%3A%26nbsp%3B%20Per%20thread%20buffers%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A120%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EUnderstanding%20a%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Buser's%20workload%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eis%20critical%20to%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eimprov%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eing%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bperformance%20against%20a%20server.%26nbsp%3B%20For%20example%2C%20for%20a%20workload%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ewith%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B150%20active%20connections%20and%20complex%20queries%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eit%20can%20be%20useful%20to%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Emodify%20certain%20per%20thread%20buffers%20for%20Azure%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EDatabase%20for%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EMySQL.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ETo%20understand%20if%20your%20queries%20are%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bper%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthread%20buffers%2C%20run%20%3CEM%3Eexplain%3C%2FEM%3E%20on%20a%20query%20and%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethen%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eunder%20the%20%E2%80%98extra%E2%80%99%20column%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20view%20the%20description%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bto%20understand%20what%20kind%20of%20buffer%20your%20query%20may%20be%20using.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIn%20most%20cases%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20tables%20are%20already%20set%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eup%20to%20have%20indexes%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20s%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eo%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bany%20complex%20join%20queries%20and%20sort%20queries%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eshould%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Balready%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebe%20using%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20given%20indexes%20to%20work%20optimally.%26nbsp%3B%20However%2C%20these%20queries%20can%20potentially%20be%20further%20optimized%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bby%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Erun%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ening%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthem%20through%20the%20Performance%20Recommendation%20feature%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bwhich%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bis%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bavailable%20as%20part%20of%20your%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EI%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Entelligent%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EP%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eerformance%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EI%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ensights%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIf%20your%20queries%20are%20already%20optimized%20for%20JOINs%20and%20ORDER%20BYS%2C%20then%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eyou%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecan%20benefit%20from%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Epreload_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20aria-level%3D%222%22%20id%3D%22toc-hId--1064439272%22%20id%3D%22toc-hId--1064439272%22%20id%3D%22toc-hId--1064439272%22%20id%3D%22toc-hId--1064439272%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22none%22%3EJoin_buffer_size%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThe%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ej%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eoin_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eparameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eis%20used%20for%20all%20index%20scans%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bas%20well%20as%20for%20joins%20that%20do%20not%20use%20indexes.%26nbsp%3B%20Thus%2C%20for%20a%20read%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eheavy%20workload%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ewith%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etables%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethat%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edon't%20have%20indexes%2C%20joins%20will%20do%20full%20table%20scans%20that%20will%20u%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ese%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bquite%20a%20bit%20of%20the%20buffer.%26nbsp%3B%20If%20join%20queries%20are%20heavy%2C%20then%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ejoin_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bcould%20be%20increased%20to%20allow%20for%20full%20table%20scans%20within%20memory.%26nbsp%3B%20Note%20that%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ejoin_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bis%20not%20only%20a%20per-thread%20buffer%20but%20also%20a%20per-join-per-thread%20buffer.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EOn%20the%20flip%20side%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esetting%20the%20value%20of%20the%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ejoin_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eparameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etoo%20hig%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eh%20c%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ean%20cause%20significant%20performance%20drops%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebecause%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethe%20majority%20of%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebuffer_size%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ballocated%20will%20not%20be%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eused%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bor%20required.%26nbsp%3B%20Thus%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esetting%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethis%20is%20a%20value%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bappropriately%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edepends%20upon%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20user's%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bindexes%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Band%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etheir%20queries.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20aria-level%3D%222%22%20id%3D%22toc-hId-1423073561%22%20id%3D%22toc-hId-1423073561%22%20id%3D%22toc-hId-1423073561%22%20id%3D%22toc-hId-1423073561%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22none%22%3ESort_buffer_size%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESimilarly%2C%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esort_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bis%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eused%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bfor%20ORDER%20BY%20and%20GROUP%20BY%20operations.%26nbsp%3B%20For%20a%20read%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eheavy%20workload%20(again%20in%20which%20tables%20don't%20have%20indexes)%2C%20sort%20queries%20require%20memory%20to%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecomplete%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20full%20sort%20operation.%26nbsp%3B%20For%20queries%20that%20can%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%E2%80%99t%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebe%20further%20optimized%20or%20can%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%E2%80%99t%20use%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eindexes%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eyou%20can%20increase%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esort_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bto%20allow%20for%20more%20performant%20queries.%26nbsp%3B%20If%20the%20metric%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esort_merge_passes'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eincreases%20quickly%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20user%E2%80%99s%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bqueries%20may%20benefit%20from%20increasing%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edefault%20256K%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esort_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%20However%2C%20if%20the%20value%20is%20set%20too%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ehigh%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20it%20will%20affect%20the%20performance%20for%20a%20smaller%20workload%20in%20which%20queries%20do%20not%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Euse%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ball%20of%26nbsp%3Bthe%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Esort_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20aria-level%3D%222%22%20id%3D%22toc-hId--384380902%22%20id%3D%22toc-hId--384380902%22%20id%3D%22toc-hId--384380902%22%20id%3D%22toc-hId--384380902%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22none%22%3EPreload_buffer_size%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'Preload_buffer_size'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bis%20useful%20when%20your%20workload%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bindexes%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eas%20does%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ean%20average%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWordPress%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bworkload%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebecause%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eit%20allocates%20the%20size%20of%20the%20buffer%20used%20to%20preload%20indexes.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIt%E2%80%99s%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eespecially%20helpful%20to%20modify%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethis%20parameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eif%20indexes%20are%20being%20used%20often%2C%20as%20it%20is%20better%20to%20read%20indexes%20from%20the%20buffer%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20aria-level%3D%221%22%20id%3D%22toc-hId-1402067353%22%20id%3D%22toc-hId-1402067353%22%20id%3D%22toc-hId-1402067353%22%20id%3D%22toc-hId-1402067353%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ESymptom%203%3A%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EImproving%20write%20transactions%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A120%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ET%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ehere%20are%20times%20whe%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3En%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ba%20user's%20workload%20may%20be%20write%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eheavy%20or%20rely%20upon%20commi%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Et%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eting%20and%20flushing%20of%20certain%20transactions.%26nbsp%3B%20In%20this%20case%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eyou%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bcan%20tune%20certain%20parameters%20to%20assist%20with%20the%20flushing%20process.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20aria-level%3D%222%22%20id%3D%22toc-hId-295677468%22%20id%3D%22toc-hId-295677468%22%20id%3D%22toc-hId-295677468%22%20id%3D%22toc-hId-295677468%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22none%22%3EInnodb_lru_scan_depth%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20parameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Especifies%20how%20far%20into%20the%20LRU%20buffer%20pool%20a%20flush%20operation%20should%20look%20for%20dirty%20pages%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%20This%20flush%20operation%20is%20run%201x%20a%20second%20and%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eused%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eby%20the%20page%20cleaner%20thread%20that%20is%20doing%20the%20scan.%20For%20most%20workloads%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eyou%20can%20set%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethis%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eparameter%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eto%20a%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Elow%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bvalue%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bas%20searching%20too%20far%20into%20the%20buffer%20pool%20could%20impact%20performance%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIn%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bour%20performance%20tests%2C%20setting%20this%20value%20lower%20than%20the%20default%20of%201024%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ebytes%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edidn%E2%80%99t%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eimprove%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eor%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edegrade%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eperformance%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eof%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ea%20read-heavy%20workload%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%20However%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Efor%20write-heavy%20workload%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Es%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethere%20was%20an%20improvement.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20aria-level%3D%222%22%20id%3D%22toc-hId--1511776995%22%20id%3D%22toc-hId--1511776995%22%20id%3D%22toc-hId--1511776995%22%20id%3D%22toc-hId--1511776995%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22none%22%3EInnodb_purge_threads%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3CI%3E%3C%2FI%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E'Innodb_purge_threads'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eis%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ba%20useful%20parameter%20when%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethere%20are%20many%20purge%20operations%20ongoing%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ei%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3En%20your%20instance.%26nbsp%3B%20Since%20a%20row%20and%20its%20records%20are%20only%20removed%20from%20memory%20when%20InnoDB%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edoes%20a%20purge%20operation%2C%20increasing%20the%20number%20of%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Einnodb_purge_threads'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eis%20also%20beneficial%2C%20especially%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Efor%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ecases%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ein%20which%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethere%20are%20many%20tables%20and%20threads%20are%20less%20likely%20to%20contend%20for%20the%20same%20tables.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH5%20id%3D%22toc-hId--162326781%22%20id%3D%22toc-hId--162326781%22%20id%3D%22toc-hId--162326781%22%20id%3D%22toc-hId--162326781%22%3E%3CI%3E%3CSPAN%20data-contrast%3D%22auto%22%3EInnodb_autoinc_lock_mode%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH5%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20parameter%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eused%20to%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eset%20the%20locking%20mechanism%20for%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Einsert-like%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Estatements%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ethat%20add%20values%20for%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etables%26nbsp%3B%3C%2FSPAN%3E%3CI%3E%3CSPAN%20data-contrast%3D%22auto%22%3EAUTO%3C%2FSPAN%3E%3C%2FI%3E%3CI%3E%3CSPAN%20data-contrast%3D%22auto%22%3E_INCREMENT%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bcolumns.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3ETypically%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthis%20value%20is%20set%20to%201%2C%20indicating%20a%20%E2%80%9Cconsecutive%E2%80%9D%20lock%20mode.%26nbsp%3B%20For%20workloads%20with%20many%20insert-like%20statements%2C%20there%20is%20an%20improvement%20in%20performance%20in%20setting%20'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Einnodb_autoinc%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E_lock_mode'%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bto%202%2C%20which%20indicates%20%E2%80%9Cinterleaved%E2%80%9D%20lock%20mode.%26nbsp%3B%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20data-contrast%3D%22auto%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20allows%20insert-like%20statements%20to%20run%20in%20a%20concurrent%20and%20scalable%20manner%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bbecause%26nbsp%3BInnoDB%26nbsp%3Bremoves%20any%20table-lock%20hold.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EYou%20should%20only%20set%20this%20value%20if%20you%20have%20no%20dependency%20on%20incremental%20consistency%26nbsp%3Bfor%20the%26nbsp%3B%3C%2FSPAN%3E%3CI%3E%3CSPAN%20data-contrast%3D%22auto%22%3EAUTO_INCREMENT%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bcolumn.%26nbsp%3B%20Further%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%2C%20setting%20the%20lock%20mode%20to%20an%20interleaved%20mechanism%20may%20not%20work%20for%20all%20write%20heavy%20scenarios%2C%20like%20those%20with%20simple%20inserts%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIt%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Balso%20is%20not%20safe%20and%20recommended%20for%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Estatement-based%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Breplication%20scenarios.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3ELeave%20a%20comment%20below%20if%20you%20have%20more%20server%20parameters%20you%20recommend%20tuning!%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EThanks%20for%20reading!%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3EMollee%20Jain%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3ESoftware%20Engineer%2C%20Azure%20OSS%20Databases%20team%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1421960%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20about%20tuning%20parameters%20to%20get%20the%20most%20performance%20from%20your%20Azure%20DB%20for%20MySQL%20server.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1675197%22%20slang%3D%22en-US%22%3ERe%3A%20Optimally%20tuning%20your%20workload%20on%20Azure%20Database%20for%20MySQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1675197%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20article%20has%20this%20formula%20with%20three%20open%20parentheses%20and%20two%20close%20parentheses.%26nbsp%3B%20Please%20correct%20the%20formula%20so%20the%20parentheses%20balance%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E(total%20memory%20-%20(base%20memory%20%2B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Esum%20of%20per-%3C%2FSPAN%3E%3CSPAN%3Econnection%20memory%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B*%20%23%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econnections%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%2F%20%23%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econnections%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

 

Overview 

When troubleshooting Azure Database for MySQL performance, it can often be hard to know which server parameters you need to adjust.  We used General Purpose 2 vCore and 4 vCore MySQL servers with a workload that consisted of ~90% read queries across 150 concurrent connections as our test environment. The recommendations and insights below were generated and tested specifically on Azure Database for MySQL instances.  

 

Symptom 1: Queries exceed temporary table sizing 

In high-read scenariosat times queries executed against the server can exceed the in-memory temporary table sizes.  If your workload exceeds the default size of temporary table sizes, then the MySQL server will switch to writing the temporary tables to disk, which can affect server performance. So how do you know if your server is writing to disk because of exceeding temporary table size? 

 

Let's take a look at our metrics, specifically for 'created_tmp_disk_tables' and 'created_tmp_tables'. 

show global status like 'created_tmp_disk_tables'; 
show global status like 'created_tmp_tables'; 

If the server creates the table on disk either initially or by converting an in-memory table, it will increment the 'created_tmp_disk_tables' status variable.  Similarly, queries performing a join or sort without the benefit of an index require the creation of a temporary table in memory, which will increment the 'created_tmp_tables' variable. 

 

NoteTo determine if running a specific query will use temporary tables, run an explain on the query. The detail in the 'extra' column indicates 'Using temporary' if the query will run using temporary tables. 

 

To calculate the percentage of your workload with queries spilling to disks, use your metric values in the formula below: 

Created_tmp_disk_tables / (Created_tmp_disk_tables + Created_tmp_tables) ) * 100 

Ideally, this percentage should be less 25%. If you see that the percentage is 25% or greater, you can modify two server parameters, 'tmp_table_size' and 'max_heap_table_size'. 

 

To calculate the values required, look at the total per-connection memory values and the base memory. The sum of per-connection memory parameters, excluding 'tmp_table_size'combined with the base memory accounts for total memory of the server.   

 

The formula to calculate the largest possible size of 'tmp_table_size' and 'max_heap_table_size' is: 

(total memory - (base memory + (sum of per-connection memory * # of connections)) / # of connections 

 

Symptom 2: Heavy contention for tables 

If a user is running several queries against tables, causing the number of opened tables to increase and potentially heavy contention on the same table, then querperformance can be impacted.  This is particularly true for a heavy-read scenario in which different tables are concurrently being opened by many connections.  You can monitor table open trends by looking at the 'opened_tables' metric. 

Let's also look at the 'table_open_cache' parameter, which is the total number of open tables allowed for all threads Based on our performance testing, a heavy-read scenario can benefit from tuning this parameter. 

 

To optimize the value of the 'table_open_cache' parameter, configure it so that approximately 50% of its value is being used by the workload. You can calculate this fairly easily using the following formula: 

Minimum table_open_cache = (total # of tables) x (# of active connections) / 2 

Italso important, however, to include the base tables within this calculation. For example, for 150 active connections with around 250 tables total, the 'table_open_cache' parameter should be at least 18,750. 

 

Similarly, for 'table_open_cache_instances', increase the value if a single table is experiencing a lot of heavy contentions of queries against it.  For 150 active connections and 250 total tables, we found a benefit by increasing 'table_open_cache_instances' from 1 to 4, especially while testing a high-read scenario.   

 

Symptom 3:  Per thread buffers 

Understanding a user's workload is critical to improving performance against a server.  For example, for a workload with 150 active connections and complex queries, it can be useful to modify certain per thread buffers for Azure Database for MySQL. 

 

To understand if your queries are using per thread buffers, run explain on a query and then under the ‘extra’ column, view the description to understand what kind of buffer your query may be using. 

In most cases, the tables are already set up to have indexes, so any complex join queries and sort queries should already be using the given indexes to work optimally.  However, these queries can potentially be further optimized by running them through the Performance Recommendation feature, which is available as part of your Intelligent Performance InsightsIf your queries are already optimized for JOINs and ORDER BYS, then you can benefit from 'preload_buffer_size'.   

 

Join_buffer_size 

The 'join_buffer_size' parameter is used for all index scans, as well as for joins that do not use indexes.  Thus, for a read-heavy workload with tables that don't have indexes, joins will do full table scans that will use quite a bit of the buffer.  If join queries are heavy, then 'join_buffer_size' could be increased to allow for full table scans within memory.  Note that 'join_buffer_size' is not only a per-thread buffer but also a per-join-per-thread buffer. 

 

On the flip side, setting the value of the 'join_buffer_size' parameter too high can cause significant performance drops because the majority of the buffer_size allocated will not be used or required.  Thus, setting this is a value appropriately depends upon a user's indexes and their queries. 

 

Sort_buffer_size 

Similarly, 'sort_buffer_size' is used for ORDER BY and GROUP BY operations.  For a read-heavy workload (again in which tables don't have indexes), sort queries require memory to complete a full sort operation.  For queries that can’t be further optimized or can’t use indexes, you can increase 'sort_buffer_size' to allow for more performant queries.  If the metric 'sort_merge_passes' increases quicklya user’s queries may benefit from increasing the default 256K 'sort_buffer_size'.  However, if the value is set too high, it will affect the performance for a smaller workload in which queries do not use all of the 'sort_buffer_size'. 

 

Preload_buffer_size 

'Preload_buffer_size' is useful when your workload is using indexes, as does an average WordPress workload, because it allocates the size of the buffer used to preload indexes.  It’s especially helpful to modify this parameter if indexes are being used often, as it is better to read indexes from the buffer. 

 

Symptom 3:  Improving write transactions 

There are times when a user's workload may be write-heavy or rely upon committing and flushing of certain transactions.  In this case, you can tune certain parameters to assist with the flushing process. 

 

Innodb_lru_scan_depth 

This parameter specifies how far into the LRU buffer pool a flush operation should look for dirty pages.  This flush operation is run 1x a second and is used by the page cleaner thread that is doing the scan. For most workloads, you can set this parameter to a low value, as searching too far into the buffer pool could impact performance.  In our performance tests, setting this value lower than the default of 1024 bytes didn’t improve or degrade the performance of a read-heavy workload. However, for write-heavy workloads there was an improvement. 

 

Innodb_purge_threads 

'Innodb_purge_threads' is a useful parameter when there are many purge operations ongoing in your instance.  Since a row and its records are only removed from memory when InnoDB does a purge operation, increasing the number of 'innodb_purge_threads' is also beneficial, especially for cases in which there are many tables and threads are less likely to contend for the same tables. 

 

Innodb_autoinc_lock_mode 

This parameter is used to set the locking mechanism for insert-like statements that add values for tables AUTO_INCREMENT columns. Typically, this value is set to 1, indicating a “consecutive” lock mode.  For workloads with many insert-like statements, there is an improvement in performance in setting 'innodb_autoinc_lock_mode' to 2, which indicates “interleaved” lock mode.  This allows insert-like statements to run in a concurrent and scalable manner because InnoDB removes any table-lock hold.  

 

You should only set this value if you have no dependency on incremental consistency for the AUTO_INCREMENT column.  Further, setting the lock mode to an interleaved mechanism may not work for all write heavy scenarios, like those with simple insertsIt also is not safe and recommended for statement-based replication scenarios.  

 

Leave a comment below if you have more server parameters you recommend tuning!

 

Thanks for reading!

Mollee Jain 

Software Engineer, Azure OSS Databases team

1 Comment
Occasional Visitor

The article has this formula with three open parentheses and two close parentheses.  Please correct the formula so the parentheses balance:

 

(total memory - (base memory + (sum of per-connection memory * # of connections)) / # of connections