{"id":28658,"date":"2020-12-29T12:09:24","date_gmt":"2020-12-29T12:09:24","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=28658"},"modified":"2022-03-29T09:00:20","modified_gmt":"2022-03-29T09:00:20","slug":"optimize-azure-synapse-analytics","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/","title":{"rendered":"Optimize Azure Synapse Analytics"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><em>Microsoft DP-200 exam is getting retired on June 30, 2021. A new replacement exam\u00a0<strong><a href=\"https:\/\/www.testpreptraining.ai\/data-engineering-on-microsoft-azure-dp-203-practice-exam\" target=\"_blank\" rel=\"noreferrer noopener\">Data Engineering on Microsoft Azure (DP-203)<\/a><\/strong>\u00a0is available.<\/em><\/strong><\/h2>\n\n\n\n<p>In this will learn about the collection of best practices to help you to achieve optimal performance from your dedicated SQL pool (formerly SQL DW) deployment. The purpose of this is to give you some basic guidance, highlight important areas of focus and to optimize Azure Synapse Analytics.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Maintain statistics<\/strong><\/h4>\n\n\n\n<p>Dedicated SQL pool (formerly SQL DW) can be configured to automatically detect and create statistics on columns. However, the query plans created by the optimizer are only as good as the available statistics. Further, it is recommended that you enable AUTO_CREATE_STATISTICS for your databases and keep the statistics updated daily.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Group INSERT statements into batches<\/strong><\/h2>\n\n\n\n<p>A one-time load to a small table with an INSERT statement or even a periodic reload of a look-up may perform well for your needs with a statement like INSERT INTO MyLookup VALUES (1, &#8216;Type 1&#8217;). However, if you need to load thousands or millions of rows throughout the day. Then, you might find that singleton INSERTS just can&#8217;t keep up. Instead, develop your processes so that they write to a file and another process periodically comes along. And then, loads this file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Use PolyBase to load and export data quickly<\/strong><\/h4>\n\n\n\n<p>Dedicated SQL pool (formerly SQL DW) supports loading and exporting data through several tools including Azure Data Factory, PolyBase, and BCP. For small amounts of data where performance isn&#8217;t critical, any tool may be sufficient for your needs. However, when you are loading or exporting large volumes of data or fast performance is needed, PolyBase is the best choice. Further, PolyBase is designed to leverage distributed nature of the system and will load and export data magnitudes faster than any other tool. PolyBase loads can be run using CTAS or INSERT INTO.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Load then query external tables<\/strong><\/h4>\n\n\n\n<p>While Polybase, also known as external tables, can be the fastest way to load data, it is not optimal for queries. Polybase tables currently only support Azure blob files and Azure Data Lake storage. However, these files do not have any compute resources backing them. As a result, dedicated SQL pool cannot offload this work and therefore must read the entire file by loading it to tempdb in order to read the data. Therefore, if you have several queries that will be querying this data, it is better to load this data once and have queries use the local table.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Hash distribute large tables<\/strong><\/h4>\n\n\n\n<p>By default, tables are Round Robin distributed. This makes it easy for users to get started creating tables without having to decide how their tables should be distributed. Round Robin tables may perform sufficiently for some workloads, but in most cases selecting a distribution column will perform much better. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Do not over-partition<\/strong><\/h4>\n\n\n\n<p>While partitioning data can be effective for maintaining your data through partition switching or optimizing scans by with partition elimination, having too many partitions can slow down your queries. Often a high granularity partitioning strategy, which may work well on SQL Server may not work well in dedicated SQL pool (formerly SQL DW). <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png\" alt=\"DP-200 practice tests\" class=\"wp-image-18535\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Minimize transaction sizes<\/strong><\/h4>\n\n\n\n<p>INSERT, UPDATE, and DELETE statements run in a transaction and when they fail they must be rolled back. However, to minimize the potential for a long rollback, minimize transaction sizes whenever possible. This can be done by dividing INSERT, UPDATE, and DELETE statements into parts. Leverage special Minimal Logging cases, like CTAS, TRUNCATE, DROP TABLE, or INSERT to empty tables, to reduce rollback risk.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Optimize clustered columnstore tables<\/strong><\/h4>\n\n\n\n<p>Clustered columnstore indexes are one of the most efficient ways you can store your data in dedicated SQL pool. By default, tables in dedicated SQL pool are created as Clustered ColumnStore. To get the best performance for queries on columnstore tables, having good segment quality is important. Further, when rows are written to columnstore tables under memory pressure, columnstore segment quality may suffer. Segment quality can be measured by number of rows in a compressed Row Group. <\/p>\n\n\n\n<p>Since columnstore tables generally won&#8217;t push data into a compressed columnstore segment. This is until there are more than 1 million rows per table and each dedicated SQL pool table is partitioned into 60 tables, as a rule of thumb. However, columnstore tables won&#8217;t benefit a query unless the table has more than 60 million rows. However, for table with less than 60 million rows, it may not make any sense to have a columnstore index. It also may not hurt.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Use larger resource class to improve query performance<\/strong><\/h4>\n\n\n\n<p>Dedicated SQL pool uses resource groups as a way to allocate memory to queries. Further, all users are assigned to the small resource class, which grants 100 MB of memory per distribution. Since there are always 60 distributions and each distribution is given a minimum of 100 MB. And, system wide the total memory allocation is 6,000 MB, or just under 6 GB.  However, utilizing larger resource classes reduces concurrency. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Use Smaller Resource Class to Increase Concurrency<\/strong><\/h4>\n\n\n\n<p>If you notice that user queries seem to have a long delay. However, it could be that your users are running in larger resource classes and are consuming many concurrency slots causing other queries to queue up. Further, to see if users queries are queued, run SELECT * FROM sys.dm_pdw_waits to see if any rows are returned.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-practice-exam\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png\" alt=\"Optimize Azure Synapse Analytics DP-200 Online course\" class=\"wp-image-18534\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference: <\/strong><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/synapse-analytics\/sql-data-warehouse\/sql-data-warehouse-best-practices\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft Documentation<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to DP-200 Tutorials Microsoft DP-200 exam is getting retired on June 30, 2021. A new replacement exam\u00a0Data Engineering on Microsoft Azure (DP-203)\u00a0is available. In this will learn about the collection of best practices to help you to achieve optimal performance from your dedicated SQL pool (formerly SQL DW) deployment. The purpose of this&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-28658","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Optimize Azure Synapse Analytics - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimize Azure Synapse Analytics - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-29T09:00:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/\",\"name\":\"Optimize Azure Synapse Analytics - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-12-29T12:09:24+00:00\",\"dateModified\":\"2022-03-29T09:00:20+00:00\",\"description\":\"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimize Azure Synapse Analytics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Optimize Azure Synapse Analytics - Testprep Training Tutorials","description":"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/","og_locale":"en_US","og_type":"article","og_title":"Optimize Azure Synapse Analytics - Testprep Training Tutorials","og_description":"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2022-03-29T09:00:20+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/","name":"Optimize Azure Synapse Analytics - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-12-29T12:09:24+00:00","dateModified":"2022-03-29T09:00:20+00:00","description":"Enhance your skills by learning about how to Optimize Azure Synapse Analytics using Microsoft DP-200 online course and Practice Exam Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/optimize-azure-synapse-analytics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Optimize Azure Synapse Analytics"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=28658"}],"version-history":[{"count":9,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28658\/revisions"}],"predecessor-version":[{"id":53780,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28658\/revisions\/53780"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=28658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=28658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=28658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}