Home
%3CLINGO-SUB%20id%3D%22lingo-sub-683210%22%20slang%3D%22en-US%22%3EThe%20best%20practices%20for%20performance%20comparison%20between%20Azure%20SQL%20Managed%20Instance%20and%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-683210%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EOne%20of%20the%20most%20common%20tasks%20that%20you%20will%20be%20performing%20while%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-migrate%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Emigrating%20from%20SQL%20Server%20to%20Managed%20Instance%3C%2FSPAN%3E%3C%2FA%3Eis%20a%20comparison%20of%20workload%20performance%20between%20the%20source%20and%20destination%20instance.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIn%20this%20post%20you%20will%20see%20some%20recommended%20tools%20and%20best%20practices%20that%20you%20should%20apply%20while%20doing%20performance%20comparison.%20The%20recommended%20performance%20comparison%20process%20has%20three%20stages%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%20start%3D%221%22%20type%3D%221%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECompare%20the%20environment%20settings%20on%20SQL%20Server%20and%20Managed%20Instance%20such%20as%20cores%2C%20memory%2C%20compatibility%20levels%2C%20etc.%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECreate%20performance%20baseline%26nbsp%3Bon%20source%20SQL%20Server%20with%20average%20CPU%2Fusage%2C%20perf%20of%20critical%20queries.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECompare%20performance%20on%20Managed%20Instance%20with%20the%20baseline%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIn%20the%20following%20sections%20will%20be%20described%20the%20best%20practices%20and%20the%20recommended%20approaches%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20inherit%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%20margin%3A%20.25in%200in%209.0pt%200in%3B%22%20id%3D%22toc-hId-1766577250%22%20id%3D%22toc-hId-1766577250%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20font-weight%3A%20normal%3B%22%3ECompare%20environment%20settings%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EThe%20first%20thing%20that%20you%20need%20to%20do%20is%20to%20ensure%20that%20the%20characteristics%20of%20your%20source%20SQL%20Server%20are%20comparable%20with%20the%20destination%20Managed%20Instance.%20Managed%20Instance%20is%20the%20latest%20version%20of%20SQL%20Server%20Database%20Engine%20hosted%20in%20special%20environment%20in%20the%20Azure%20cloud%20with%20built-in%20high-availability%20capabilities.%20This%20means%20that%20you%20might%20experiences%20differences%20in%20the%20workload%20performance%20compared%20to%20your%20on-premises%20version%20of%20SQL%20Server.%26nbsp%3BLearn%20about%20the%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fblog%2Fkey-causes-of-performance-differences-between-sql-managed-instance-and-sql-server%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Ekey%20environment%20differences%20that%20might%20cause%20the%20performance%20differences%3C%2FSPAN%3E%3C%2FA%3E%20between%20Managed%20Instance%20and%20SQL%20Server%20and%20identify%20the%20risks%20that%20might%20affect%20the%20performance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIn%20order%20to%20minimize%20number%20of%20factors%20that%20could%20affect%20performance%20of%20your%20workload%2C%20you%20should%20try%20to%20align%20the%20settings%20on%20your%20Managed%20Instance%20with%20the%20original%20settings%20on%20the%20source%20SQL%20Server.%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3ETwo%20very%20common%20reasons%20that%20cause%20performance%20differences%20are%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22word-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%22%3EYou%20are%20comparing%20two%20instances%20with%20the%20different%20technical%20characteristics%20(cores%2C%20memory)%3C%2FLI%3E%0A%3CLI%20style%3D%22word-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%22%3EThere%20are%20some%20instance%2Fdatabase%20settings%20that%20are%20causing%20differences%20(compatibility%20levels%2C%20legacy%20cardinality%20estimator%2C%20maxdop%2C%20cost%20threshold%20for%20parallelism)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CFONT%20face%3D%22%26quot%3Binherit%26quot%3B%2Cserif%22%3EM%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3Eake%20sure%20that%20you%20choose%20the%20Managed%20Instance%20configuration%20with%20the%20characteristics%20that%20match%20your%20SQL%20Server%20database.%20The%20most%20important%20factors%20for%20comparison%20are%20number%20of%20cores%2C%20amount%20of%20memory%2C%20and%20IO%20characteristics.%20Use%20the%20following%20methods%20to%20verify%20that%20you%20have%20configured%20the%20Managed%20Instance%20with%20the%20matching%20characteristics%3A%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20list-style-position%3A%20outside%3B%20word-spacing%3A%200px%3B%22%20type%3D%22disc%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-SQL-Database%2FMonitor-CPU-usage-on-SQL-Server%2Fba-p%2F680777%23M131%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%20data-linktype%3D%22external%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EMonitor%20CPU%20usage%20on%20your%20SQL%20Server%20instance%3C%2FSPAN%3E%3C%2FA%3E%20and%20check%20how%20much%20compute%20power%20(CPU%20cores)%20you%20currently%20use%20(using%20Dynamic%20Management%20Views%2C%20SQL%20Server%20Management%20Studio%2C%20or%20other%20monitoring%20tools).%20You%20can%20provision%20a%20Managed%20Instance%20that%20matches%20the%20number%20of%20cores%20that%20you%20are%20using%20on%20SQL%20Server%2C%20keeping%20in%20mind%20that%20CPU%20characteristics%20might%20need%20to%20be%20scaled%20to%20match%20the%26nbsp%3B%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsql-database%2Fsql-database-managed-instance-resource-limits%23hardware-generation-characteristics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-linktype%3D%22external%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Echaracteristics%20of%20the%20VM%20on%20which%20the%20Managed%20Instance%20is%20installed%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECheck%20the%20amount%20of%20available%20memory%20on%20your%20SQL%20Server%20instance%20and%20choose%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsql-database%2Fsql-database-managed-instance-resource-limits%23hardware-generation-characteristics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-linktype%3D%22external%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Ethe%20service%20tier%20that%20has%20a%20matching%20amount%20of%20memory%3C%2FSPAN%3E%3C%2FA%3E.%20Measure%20page-life%20expectancy%20on%20your%20SQL%20Server%20instance%20to%20determine%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-SQL-Database%2FDo-you-need-more-memory-on-Azure-SQL-Managed-Instance%2Fba-p%2F563444%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%20data-linktype%3D%22external%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Edo%20you%20need%20additional%20memory%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fwww.sqlskills.com%2Fblogs%2Fpaul%2Fhow-to-examine-io-subsystem-latencies-from-within-sql-server%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EMeasure%20IO%20latency%20of%20the%20file%20subsystem%3C%2FSPAN%3E%3C%2FA%3E%20to%20choose%20between%20General%20Purpose%20(5-10ms)%20and%20Business%20Critical%20(1-3ms)%20service%20tiers.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EAlso%2C%20make%20sure%20that%20you%20implement%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FDataCAT%2FStorage-performance-best-practices-and-considerations-for-Azure%2Fba-p%2F305525%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Estorage%20best%20practice%20guidelines%20for%20General%20Purpose%3C%2FSPAN%3E%3C%2FA%3E%20such%20as%20pre-allocating%20the%20size%20of%20the%20files%20to%20get%20the%20better%20performance.%20Beware%20that%20increasing%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Fincreasing-data-files-might-improve-performance-on-general-purpose-managed-instance-tier-6e90bad2ae4b%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Edata%20files%3C%2FSPAN%3E%3C%2FA%3E%20or%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Fimpact-of-log-file-size-on-general-purpose-managed-instance-performance-21ad170c823e%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Elog%20file%20sizes%3C%2FSPAN%3E%3C%2FA%3E%20might%20improve%20performance%20of%20your%20General%20Purpose%20instance.%20You%20should%20perform%20these%20settings%20before%20you%20start%20comparison.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EThere%20are%20also%20many%20settings%20like%20compatibility%20levels%20or%20cardinality%20estimation%20algorithms%2C%20that%20can%20cause%20unexpected%20difference%20in%20performance.%20In%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Fcompare-environment-settings-on-sql-server-and-azure-sql-that-may-impact-performance-e90c21fa9b08%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Ethis%20article%3C%2FSPAN%3E%3C%2FA%3E%20you%20can%20find%20the%20scripts%20that%20you%20can%20use%20to%20compare%20environment%20settings.%20Scripts%20used%20in%20this%20article%20are%20found%20on%20SQL%20Server%20GitHub%20repository%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%20start%3D%221%22%20type%3D%221%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fsql-server-samples%2Fmaster%2Fsamples%2Fmanage%2Fazure-sql-db-managed-instance%2Fcompare-environment-settings%2Fget-properties.sql%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EGet-properties.sql%3C%2FSPAN%3E%3C%2FA%3Ethat%20reads%20various%20instance%2C%20database%2C%20tempdb%2C%20trace%20flag%20values%20and%20produces%20a%20XML%20document%20with%20all%20properties.%20You%20should%20execute%20this%20script%20once%20on%20the%20source%20database%20and%20then%20on%20the%20destination%20database.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fsql-server-samples%2Fmaster%2Fsamples%2Fmanage%2Fazure-sql-db-managed-instance%2Fcompare-environment-settings%2Fcompare-properties.sql%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3ECompare-properties.sql%3C%2FSPAN%3E%3C%2FA%3E%26nbsp%3Bcompares%20the%20values%20in%20the%20XML%20generated%20by%20the%20previous%20script%20and%20shows%20the%20differences.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3ETry%20to%20resolve%20the%20differences%20or%20understand%20how%20the%20differences%20would%20affect%20the%20performance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20inherit%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%20margin%3A%20.25in%200in%209.0pt%200in%3B%22%20id%3D%22toc-hId--785579711%22%20id%3D%22toc-hId--785579711%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20font-weight%3A%20normal%3B%22%3ECreate%20performance%20baseline%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIf%20you%20need%20to%20compare%20the%20performance%20of%20your%20workload%20on%20Managed%20Instance%20with%20your%20original%20workload%20running%20on%20SQL%20Server%2C%20you%20would%20need%20to%20create%20a%20performance%20baseline%20that%20will%20be%20used%20for%20comparison.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3ESome%20of%20the%20parameters%20that%20you%20would%20need%20to%20measure%20on%20your%20SQL%20Server%20instance%20are%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20list-style-position%3A%20outside%3B%20word-spacing%3A%200px%3B%22%20type%3D%22disc%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-SQL-Database%2FMonitor-CPU-usage-on-SQL-Server%2Fba-p%2F680777%23M131%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EMonitor%20CPU%20usage%20on%20your%20SQL%20Server%20instance%3C%2FSPAN%3E%3C%2FA%3E%20and%20record%20the%20average%20and%20peak%20CPU%20usage.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Frelational-databases%2Fperformance-monitor%2Fmonitor-memory-usage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EMonitor%20memory%20usage%20on%20your%20SQL%20Server%20instance%3C%2FSPAN%3E%3C%2FA%3E%20and%20determine%20the%20amount%20of%20memory%20used%20by%20different%20components%20such%20as%20buffer%20pool%2C%20plan%20cache%2C%20column-store%20pool%2C%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Fin-memory-oltp%2Fmonitor-and-troubleshoot-memory-usage%3Fview%3Dsql-server-2017%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EIn-memory%20OLTP%3C%2FSPAN%3E%3C%2FA%3E%2C%20etc.%20In%20addition%2C%20find%20average%20and%20peak%20values%20of%20Page%20Life%20Expectancy%20memory%20performance%20counter.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3E%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fwww.sqlskills.com%2Fblogs%2Fpaul%2Fhow-to-examine-io-subsystem-latencies-from-within-sql-server%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EMonitor%20disk%20IO%20usage%20on%20the%20source%20SQL%20Server%20instance%3C%2FSPAN%3E%3C%2FA%3E%20using%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Frelational-databases%2Fsystem-dynamic-management-views%2Fsys-dm-io-virtual-file-stats-transact-sql%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Edm_io_virtual_file_stats%3C%2FSPAN%3E%3C%2FA%3E%20view%20or%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Frelational-databases%2Fperformance-monitor%2Fmonitor-disk-usage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Eperformance%20counters%3C%2FSPAN%3E%3C%2FA%3E.%20Try%20to%20measure%20IO%20performance%20on%20databases%20where%20you%20are%20running%20the%20workload%20and%20tempdb.%20See%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fsqlperformance.com%2F2013%2F10%2Ft-sql-queries%2Fio-latency%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Ethis%20article%20from%20more%20details%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EMonitor%20workload%20and%20query%20performance%20for%20your%20SQL%20Server%20instance%20by%20examining%20Dynamic%20Management%20Views%20or%20Query%20Store%20if%20you%20are%20migrating%20from%20SQL%20Server%202016%2B%20version.%20Identify%20average%20duration%20and%20CPU%20usage%20of%20the%20most%20important%20queries%20in%20your%20workload%20to%20compare%20them%20with%20the%20queries%20that%20are%20running%20on%20the%20Managed%20Instance.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIf%20you%20notice%20any%20issue%20with%20your%20workload%20on%20SQL%20Server%20such%20as%20high%20CPU%20usage%2C%20constant%20memory%20pressure%2C%20tempdb%20or%20parametrization%20issues%2C%20you%20should%20try%20to%20resolve%20them%20on%20your%20source%20SQL%20Server%20instance%20%3CEM%3Ebefore%3C%2FEM%3Etaking%20the%20baseline%20and%20migration.%20Migrating%20known%20issues%20to%20any%20new%20system%20might%20cause%20unexpected%20results%20and%20invalidate%20any%20performance%20comparison.%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EAs%20an%20outcome%20of%20this%20activity%20you%20should%20have%20documented%20average%20and%20peak%20values%20for%20%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%22%3ECPU%3C%2FSPAN%3E%3C%2FSTRONG%3E%2C%20%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%22%3Ememory%3C%2FSPAN%3E%3C%2FSTRONG%3E%2C%20and%20%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%22%3EIO%20usage%3C%2FSPAN%3E%3C%2FSTRONG%3E%20on%20your%20source%20system%2C%20as%20well%20as%20average%20and%20max%20duration%20and%20CPU%20usage%20of%20the%20dominant%20and%20the%20most%20critical%20queries%20in%20your%20workload.%20You%20should%20use%20these%20values%20later%20to%20compare%20performance%20of%20your%20workload%20on%20Managed%20Instance%20with%20the%20baseline%20performance%20of%20the%20workload%20on%20the%20source%20SQL%20Server.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EIf%20possible%2C%20take%20the%20actual%20execution%20plans%20of%20the%20most%20critical%20queries%20so%20you%20can%20compare%20them%20with%20the%20execution%20plans%20generated%20by%20Managed%20Instance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20inherit%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%20margin%3A%20.25in%200in%209.0pt%200in%3B%22%20id%3D%22toc-hId-957230624%22%20id%3D%22toc-hId-957230624%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20font-weight%3A%20normal%3B%22%3ECompare%20performance%20with%20the%20baseline%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EOnce%20you%20are%20sure%20that%20Managed%20Instance%20and%20SQL%20server%20do%20not%20have%20critical%20differences%20and%20when%20you%20have%20information%20about%20the%20performance%20baseline%20on%20SQL%20Server%2C%20it%20is%20time%20to%20run%20the%20workload%20on%20Managed%20Instance%20and%20measure%20the%20performance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EMake%20sure%20that%20you%20keep%20the%20same%20database%20compatibility%20level%20as%20on%20your%20source%20SQL%20Server%20database%20and%20enable%20Query%20Store%20and%20Automatic%20tuning%20on%20your%20Managed%20Instance.%20These%20features%20enable%20you%20to%20measure%20workload%20performance%20and%20automatically%20fix%20potential%20performance%20issues.%20Learn%20how%20to%20use%20Query%20Store%20as%20an%20optimal%20tool%20for%20getting%20information%20about%20workload%20performance%20before%20and%20after%20database%20compatibility%20level%20change%2C%20as%20explained%20in%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Frelational-databases%2Fperformance%2Fquery-store-usage-scenarios%23CEUpgrade%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-linktype%3D%22external%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EKeep%20performance%20stability%20during%20the%20upgrade%20to%20newer%20SQL%20Server%20version%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EOnce%20you%20have%20prepared%20the%20environment%20that%20is%20comparable%20(as%20much%20as%20possible)%20with%20your%20on-premises%20environment%2C%20you%20can%20start%20running%20your%20workload%20and%20measure%20performance%20again.%20Make%20sure%20that%20you%20are%20using%20the%20same%20tools%20both%20on%20SQL%20Server%20and%20Managed%20Instance%20to%20measure%20performance%20to%20get%20the%20consistent%20results.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EAs%20a%20result%2C%20you%20should%20compare%20performance%20parameters%20with%20the%20baseline%20and%20identify%20the%20critical%20differences.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EResolve%20performance%20issues%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3EIf%20you%20see%20performance%20differences%20in%20queries%20that%20are%20not%20running%20fine%20on%20Managed%20Instance%2C%20you%20should%20identify%20the%20root%20causes%20and%20resolve%20the%20issues.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22word-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%22%3E%3CEM%3EPerformance%20of%20the%20workload%20on%20Managed%20Instance%20is%20lower.%3C%2FEM%3E%26nbsp%3BIn%20this%20case%20you%20should%20make%20some%20configuration%20change%20on%20your%20managed%20instance%20to%20configure%20it%20to%20fit%20your%20workload.%3C%2FLI%3E%0A%3CLI%20style%3D%22word-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%22%3E%3CEM%3EWorkload%20performance%20is%20similar%20with%20some%20exceptions%20where%20some%20of%20the%20queries%20might%20run%20slower%3C%2FEM%3E.%20In%20this%20case%2C%20you%20should%20focus%20on%20the%20queries%20with%20different%20performance%20and%20try%20to%20fix%20them.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3EThese%20two%20cases%20will%20be%20discussed%20in%20more%20details%20in%20the%20next%20two%20sections.%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSTRONG%3ECase%201%3A%20Performance%20of%20most%20of%20the%20queries%20are%20different%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EIf%20the%20performance%20of%20the%20workload%20on%20SQL%20Server%20is%20better%20than%20performance%20of%20the%20same%20workload%20on%20Managed%20Instance%20for%20most%20of%20the%20queries%20in%20your%20workload%2C%20you%20need%20to%20change%20something%20in%20you%20database%20or%20Managed%20Instance.%20Do%20not%20try%20to%20analyze%20and%20correct%20individual%20queries%2C%20because%20there%20is%20probably%20some%20global%20setting%20that%20will%20fix%20most%20of%20them.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20face%3D%22%26quot%3B%26amp%3Bquot%26quot%3B%2Cserif%22%3EY%3C%2FFONT%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3Eou%20would%20need%20to%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Fwhat-to-do-when-azure-sql-managed-instance-is-slower-than-sql-server-dd39942aaadd%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Eidentify%20what%20could%20cause%20the%20differences%3C%2FSPAN%3E%3C%2FA%3E.%20In%20most%20cases%20it%20is%20some%20of%20the%20differences%20that%20might%20cause%20the%20performance%20differences%20between%20Managed%20Instance%20and%20SQL%20Server.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EOnce%20you%20identify%20the%20root%20causes%2C%20you%20should%20try%20to%20fix%20them.%20Since%20most%20of%20the%20queries%20are%20affected%20in%20this%20scenario%2C%20you%20should%20probably%20try%20to%20upgrade%20to%20the%20latest%20compatibility%20level%20and%20apply%20some%20query%20optimization%20hints%20at%20the%20database%20level.%20If%20you%20notice%20that%20IO%20is%20the%20bottleneck%20in%20General%20Purpose%20instance%2C%20you%20might%20need%20to%20increase%20data%20files%20or%20log%20file%20sizes%20might%20improve%20performance%20of%20your%20General%20Purpose%20instance.%20After%20a%20few%20iterations%20of%20changes%20except%20to%20see%20the%20workload%20performance%20align%20with%20your%20SQL%20Server%20workload%2C%20unless%20if%20there%20are%20some%20physical%20limitations%20that%20affect%20your%20workload%2C%20for%20example%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Flog-rate-throughput-cap-on-managed-instance-bbf29aa19f80%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Einstance%20log%20rate%20limit%3C%2FSPAN%3E%3C%2FA%3Eor%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-SQL-Database%2FDo-you-need-more-memory-on-Azure-SQL-Managed-Instance%2Fba-p%2F563444%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Enot%20enough%20memory%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECase%202%3A%20Performance%20of%20some%20queries%20are%20different%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EIn%20this%20case%2C%20you%20know%20that%20performance%20of%20the%20workload%20is%20fine%2C%20with%20some%20exceptions%20where%20performance%20of%20a%20couple%20of%20queries%20is%20degraded.%20In%20this%20case%20you%20should%20try%20to%20fix%20these%20queries%20because%20you%20have%20most%20of%20your%20workload%20tuned.%20Try%20to%20identify%20why%20the%20queries%20are%20slower%20before%20making%20some%20changes%20%E2%80%93%20some%20hints%20are%3A%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%221%22%20type%3D%221%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EIn%20most%20cases%20you%20will%20see%20that%20you%20are%20hitting%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Flog-rate-throughput-cap-on-managed-instance-bbf29aa19f80%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Einstance%20log%20rate%20limit%3C%2FSPAN%3E%3C%2FA%3Eand%20there%20is%20nothing%20that%20you%20can%20do%20in%20this%20case.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ESometimes%20you%20will%20notice%20some%20unexpected%20action%20like%20ongoing%20automatic%20backup%20that%20can%20temporary%20affect%20performance%20%E2%80%93%20see%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Frunning-hammerdb-on-tpcc5000-database-on-general-purpose-tier-of-managed-instance-9c10e40581ac%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3Ethe%20example%20in%20TPCC%20experiment%3C%2FSPAN%3E%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3COL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%20start%3D%221%22%20type%3D%221%22%3E%0A%3COL%20start%3D%221%22%20type%3D%221%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3ECompare%20the%20SQL%20plans%20of%20the%20queries%20on%20SQL%20Server%20with%20the%20queries%20on%20Managed%20Instance.%20If%20the%20query%20plans%20are%20different%20try%20to%20apply%20some%20query%20hints%20that%20change%20compatibility%20levels%20or%20cardinality%20estimators.%20You%20can%20apply%20these%20hints%20directly%20in%20the%20queries%20or%20use%20the%20plan%20guides%20to%20modify%20the%20SQL%20plan.%20The%20goal%20is%20to%20force%20the%20Database%20Engine%20to%20produce%20the%20same%20good%20plan%20as%20on%20your%20older%20version%20of%20SQL%20Server.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EIf%20the%20SQL%20plans%20are%20same%2C%20check%20if%20the%20query%20plan%20uses%20more%20resources%20on%20Managed%20Instance.%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FOL%3E%0A%3CUL%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20list-style-position%3A%20outside%3B%20word-spacing%3A%200px%3B%22%20type%3D%22disc%22%3E%0A%3CLI%20style%3D%22color%3A%20%23333333%3B%20line-height%3A%20normal%3B%20%3B%20font-size%3A%2012pt%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'%26amp%3Bquot'%2Cserif%3B%22%3EIn%20other%20cases%2C%20you%20will%20notice%20you%20are%20hitting%20limits%20on%20data%20or%20log%20files%20and%20you%20might%20need%20to%20pre-allocate%20the%20files.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EAs%20a%20results%20of%20this%20comparison%2C%20you%20can%20validate%20that%20the%20performance%20of%20your%20workload%20is%20matching%20the%20source%20SQL%20Server%20or%20you%20will%20identify%20the%20factors%20that%20might%20cause%20the%20difference%20and%20fix%20these%20issues.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EFind%20more%20information%20about%20the%20best%20practices%20during%20migration%20on%20%3CA%20style%3D%22box-sizing%3A%20border-box%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-migrate%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22color%3A%20%23146cac%3B%22%3EAzure%20SQL%20Managed%20Instance%20documentation%3C%2FSPAN%3E%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-683210%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20article%20describes%20some%20best%20practices%20and%20guidelines%20that%20can%20help%20you%20to%20compare%20the%20performance%20of%20your%20workload%20on%20Azure%20SQL%20Managed%20Instance%20and%20SQL%20Server.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-683210%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPerformance%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

One of the most common tasks that you will be performing while migrating from SQL Server to Managed Instance is a comparison of workload performance between the source and destination instance. 

In this post you will see some recommended tools and best practices that you should apply while doing performance comparison. The recommended performance comparison process has three stages:

  1. Compare the environment settings on SQL Server and Managed Instance such as cores, memory, compatibility levels, etc. 
  2. Create performance baseline on source SQL Server with average CPU/usage, perf of critical queries.
  3. Compare performance on Managed Instance with the baseline

In the following sections will be described the best practices and the recommended approaches 

Compare environment settings

The first thing that you need to do is to ensure that the characteristics of your source SQL Server are comparable with the destination Managed Instance. Managed Instance is the latest version of SQL Server Database Engine hosted in special environment in the Azure cloud with built-in high-availability capabilities. This means that you might experiences differences in the workload performance compared to your on-premises version of SQL Server. Learn about the key environment differences that might cause the performance differences between Managed Instance and SQL Server and identify the risks that might affect the performance.

 

In order to minimize number of factors that could affect performance of your workload, you should try to align the settings on your Managed Instance with the original settings on the source SQL Server.

Two very common reasons that cause performance differences are:

  • You are comparing two instances with the different technical characteristics (cores, memory)
  • There are some instance/database settings that are causing differences (compatibility levels, legacy cardinality estimator, maxdop, cost threshold for parallelism)

Make sure that you choose the Managed Instance configuration with the characteristics that match your SQL Server database. The most important factors for comparison are number of cores, amount of memory, and IO characteristics. Use the following methods to verify that you have configured the Managed Instance with the matching characteristics:

Also, make sure that you implement storage best practice guidelines for General Purpose such as pre-allocating the size of the files to get the better performance. Beware that increasing data files or log file sizes might improve performance of your General Purpose instance. You should perform these settings before you start comparison.

 

There are also many settings like compatibility levels or cardinality estimation algorithms, that can cause unexpected difference in performance. In this article you can find the scripts that you can use to compare environment settings. Scripts used in this article are found on SQL Server GitHub repository:

  1. Get-properties.sql that reads various instance, database, tempdb, trace flag values and produces a XML document with all properties. You should execute this script once on the source database and then on the destination database.
  2. Compare-properties.sql compares the values in the XML generated by the previous script and shows the differences.

Try to resolve the differences or understand how the differences would affect the performance.

Create performance baseline

If you need to compare the performance of your workload on Managed Instance with your original workload running on SQL Server, you would need to create a performance baseline that will be used for comparison.

Some of the parameters that you would need to measure on your SQL Server instance are:

 

If you notice any issue with your workload on SQL Server such as high CPU usage, constant memory pressure, tempdb or parametrization issues, you should try to resolve them on your source SQL Server instance before taking the baseline and migration. Migrating known issues to any new system might cause unexpected results and invalidate any performance comparison.

 

As an outcome of this activity you should have documented average and peak values for CPU, memory, and IO usage on your source system, as well as average and max duration and CPU usage of the dominant and the most critical queries in your workload. You should use these values later to compare performance of your workload on Managed Instance with the baseline performance of the workload on the source SQL Server.

If possible, take the actual execution plans of the most critical queries so you can compare them with the execution plans generated by Managed Instance.

Compare performance with the baseline

Once you are sure that Managed Instance and SQL server do not have critical differences and when you have information about the performance baseline on SQL Server, it is time to run the workload on Managed Instance and measure the performance.

 

Make sure that you keep the same database compatibility level as on your source SQL Server database and enable Query Store and Automatic tuning on your Managed Instance. These features enable you to measure workload performance and automatically fix potential performance issues. Learn how to use Query Store as an optimal tool for getting information about workload performance before and after database compatibility level change, as explained in Keep performance stability during the upgrade to newer SQL Server version.

 

Once you have prepared the environment that is comparable (as much as possible) with your on-premises environment, you can start running your workload and measure performance again. Make sure that you are using the same tools both on SQL Server and Managed Instance to measure performance to get the consistent results.

As a result, you should compare performance parameters with the baseline and identify the critical differences.

 

Resolve performance issues

If you see performance differences in queries that are not running fine on Managed Instance, you should identify the root causes and resolve the issues.

  • Performance of the workload on Managed Instance is lower. In this case you should make some configuration change on your managed instance to configure it to fit your workload.
  • Workload performance is similar with some exceptions where some of the queries might run slower. In this case, you should focus on the queries with different performance and try to fix them.

These two cases will be discussed in more details in the next two sections.

 

Case 1: Performance of most of the queries are different

 

If the performance of the workload on SQL Server is better than performance of the same workload on Managed Instance for most of the queries in your workload, you need to change something in you database or Managed Instance. Do not try to analyze and correct individual queries, because there is probably some global setting that will fix most of them.

You would need to identify what could cause the differences. In most cases it is some of the differences that might cause the performance differences between Managed Instance and SQL Server.

Once you identify the root causes, you should try to fix them. Since most of the queries are affected in this scenario, you should probably try to upgrade to the latest compatibility level and apply some query optimization hints at the database level. If you notice that IO is the bottleneck in General Purpose instance, you might need to increase data files or log file sizes might improve performance of your General Purpose instance. After a few iterations of changes except to see the workload performance align with your SQL Server workload, unless if there are some physical limitations that affect your workload, for example instance log rate limit or not enough memory.

 

Case 2: Performance of some queries are different

In this case, you know that performance of the workload is fine, with some exceptions where performance of a couple of queries is degraded. In this case you should try to fix these queries because you have most of your workload tuned. Try to identify why the queries are slower before making some changes – some hints are:

  1. In most cases you will see that you are hitting instance log rate limit and there is nothing that you can do in this case.
  2. Sometimes you will notice some unexpected action like ongoing automatic backup that can temporary affect performance – see the example in TPCC experiment.
    1. Compare the SQL plans of the queries on SQL Server with the queries on Managed Instance. If the query plans are different try to apply some query hints that change compatibility levels or cardinality estimators. You can apply these hints directly in the queries or use the plan guides to modify the SQL plan. The goal is to force the Database Engine to produce the same good plan as on your older version of SQL Server.
    2. If the SQL plans are same, check if the query plan uses more resources on Managed Instance.
  • In other cases, you will notice you are hitting limits on data or log files and you might need to pre-allocate the files.

As a results of this comparison, you can validate that the performance of your workload is matching the source SQL Server or you will identify the factors that might cause the difference and fix these issues.

 

Find more information about the best practices during migration on Azure SQL Managed Instance documentation