{"id":88901,"date":"2020-10-22T12:32:37","date_gmt":"2020-10-22T12:32:37","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=88901"},"modified":"2020-10-22T12:32:37","modified_gmt":"2020-10-22T12:32:37","slug":"what-youll-learn-at-my-2020-pass-summit-presentation","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/what-youll-learn-at-my-2020-pass-summit-presentation\/","title":{"rendered":"What you\u2019ll learn at my 2020 PASS Summit presentation"},"content":{"rendered":"<p>T-SQL is my favorite aspect of working with SQL Server. The release of SQL Server 2005 coincided with the beginning of my involvement with the community as a presenter and author. For a while, I would put together a \u201cWhat\u2019s new with T-SQL\u201d session for each release. Eventually, the windowing functions were such a big part of my material, that I began focusing on them.<\/p>\n<p>In SQL Server 2017 and 2019, I\u2019m less excited about the new things one can do in T-SQL than I am about the optimizer enhancements that improve performance without making code changes. This group of features is called <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/performance\/intelligent-query-processing?view=sql-server-ver15\">Intelligent Query Processing<\/a> (IQP). With these enhancements, Microsoft has addressed some of the typical antipatterns that cause queries to run slow.<\/p>\n<p>Back in my consulting days, I would often see these \u201cred flags\u201d and teach the customer why these patterns were usually bad while coming up with alternative solutions.<\/p>\n<p>One example involved scalar UDFs (user defined functions) that were nested several layers deep in a query. There was no advantage to using the UDFs, except for making the query look nicer. It was also a dev shop with no database expert on staff, and they were approaching SQL Server they way that they wrote C# by using functions to hide complexity. By replacing the UDFs with code in the query and adding a couple of appropriate indexes, the query went from 60 minutes down to a few seconds. Until the version of 2019 of SQL Server, that was always the best approach.<\/p>\n<p>As part of the SQL Server 2019 set of IQP features, Microsoft introduced <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/performance\/intelligent-query-processing?view=sql-server-ver15#scalar-udf-inlining\">Scalar UDF Inlining<\/a>. In certain situations, the optimizer can treat the UDF as if the code inside it is just part of the query. Performance can drastically improve. This works for UDFs containing formulas, IF blocks, and queries. It doesn\u2019t work for UDFs with WHILE loops, table variables, and time-dependent functions like GETDATE, for example. Actually, the list of exceptions is quite long, so be sure to take a look at the documentation.<\/p>\n<p>During my session, I\u2019ll demonstrate how query performance can improve just by upgrading. I\u2019ll talk about what to watch out for and how to turn off the features at the database or query level when they don\u2019t make sense.<\/p>\n<p>There are seven enhancements that I\u2019ll cover during my talk at the 2020 <a href=\"https:\/\/www.pass.org\/summit\/2020\/Register-Now\">Virtual PASS Summit<\/a>. I hope you will join me!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>T-SQL is my favorite aspect of working with SQL Server. The release of SQL Server 2005 coincided with the beginning of my involvement with the community as a presenter and author. For a while, I would put together a \u201cWhat\u2019s new with T-SQL\u201d session for each release. Eventually, the windowing functions were such a big&#8230;&hellip;<\/p>\n","protected":false},"author":110218,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[5134],"coauthors":[11292],"class_list":["post-88901","post","type-post","status-publish","format-standard","hentry","category-blogs","tag-sql-prompt"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/88901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/110218"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=88901"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/88901\/revisions"}],"predecessor-version":[{"id":88902,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/88901\/revisions\/88902"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=88901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=88901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=88901"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=88901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}