<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance on Andy M Mallon - AM²</title><link>https://am2.co/category/performance/</link><description>Recent content in Performance on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 13 Feb 2024 12:41:20 -0500</lastBuildDate><atom:link href="https://am2.co/category/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>T-SQL Tuesday: The last ticket I closed</title><link>https://am2.co/2024/02/13/the-last-ticket-i-closed/</link><pubDate>Tue, 13 Feb 2024 12:41:20 -0500</pubDate><guid>https://am2.co/2024/02/13/the-last-ticket-i-closed/</guid><description>&lt;p&gt;&lt;a href="https://www.brentozar.com/archive/2024/02/tsql2sday-invitation-describe-the-most-recent-issue-you-closed/"&gt;&lt;img src="https://am2.co/wp-content/uploads/TSQLTuesday1.jpg" alt="T-SQL Tuesday logo" width="300" height="300" class="alignright size-full wp-image-395" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;blockquote&gt;For &lt;a href="https://www.brentozar.com/archive/2024/02/tsql2sday-invitation-describe-the-most-recent-issue-you-closed/"&gt;this month's T-SQL Tuesday&lt;/a&gt;, Brent Ozar (&lt;a href="http://www.brentozar.com/archive/author/brento/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;|&lt;a href="https://instagram.com/BrentO" rel="noopener" target="_blank"&gt;Instagram&lt;/a&gt;) asks us to describe the most recent ticket we closed.&lt;/blockquote&gt;&#10;&lt;h2 id="we-had-a-pretty-significant-wait-spike"&gt;&amp;ldquo;We had a pretty significant wait spike&amp;hellip;&amp;rdquo;&lt;/h2&gt;&#10;&lt;p&gt;The literal last ticket I closed was &amp;ldquo;please run this script in production&amp;hellip;&amp;rdquo;, and I don&amp;rsquo;t think it would be a very interesting blog post to talk about how I copy &amp;amp; pasted a query into SSMS, so let&amp;rsquo;s talk about &lt;em&gt;a recent&lt;/em&gt; ticket instead, from the last couple of weeks.&lt;/p&gt;</description></item><item><title>Making non-SARGable queries seek, without changing the query</title><link>https://am2.co/2020/05/06/making-non-sargable-queries-seek-without-changing-the-query/</link><pubDate>Wed, 06 May 2020 08:36:27 -0400</pubDate><guid>https://am2.co/2020/05/06/making-non-sargable-queries-seek-without-changing-the-query/</guid><description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=tALDcVmWE9w" rel="noopener noreferrer" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/sarg-pubs-featured-1024x577.png" alt="" width="512" height="289" class="alignright size-large wp-image-3253" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;We&amp;rsquo;ve all been there. You&amp;rsquo;ve got a query where the &lt;code&gt;JOIN&lt;/code&gt; or &lt;code&gt;WHERE&lt;/code&gt; predicate is not &lt;a href="https://dba.stackexchange.com/a/217983/52344" rel="noopener noreferrer" target="_blank"&gt;SARGable&lt;/a&gt;. You&amp;rsquo;ve read about how &lt;a href="https://www.erikdarlingdata.com/2019/04/slightly-less-not-sargable/" rel="noopener noreferrer" target="_blank"&gt;this can be a problem&lt;/a&gt;, and &lt;a href="https://www.erikdarlingdata.com/2019/04/slightly-less-not-sargable/" rel="noopener noreferrer" target="_blank"&gt;how bad it is for performance&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Alas, you cannot change the query. Sometimes this reason is political, sometimes it&amp;rsquo;s because you&amp;rsquo;ve got a third-party app and simply don&amp;rsquo;t have access to the code. But you do have access to the database&amp;hellip;&lt;/p&gt;</description></item><item><title>Stop trying to shrink tempdb files</title><link>https://am2.co/2020/04/28/stop-trying-to-shrink-tempdb/</link><pubDate>Tue, 28 Apr 2020 09:00:24 -0400</pubDate><guid>https://am2.co/2020/04/28/stop-trying-to-shrink-tempdb/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:455px"&gt;&lt;a href="https://ShouldIShrinkMyDatabase.com"&gt;&lt;img src="https://am2.co/wp-content/uploads/black-and-white-cat-1317844-910x1024.jpg" alt="" width="341" height="384" class="size-large wp-image-3090" /&gt;&lt;/a&gt; Every time someone shrinks a database, a kitten dies. &lt;/figure&gt;&#10;&lt;h2 id="stop-shrinking-your-tempdb-data-files"&gt;Stop shrinking your tempdb data files&lt;/h2&gt;&#10;&lt;p&gt;I recently wrote about &lt;a href="https://am2.co/2020/04/21/fixing-tempdb/"&gt;growing, shrinking, and removing tempdb files&lt;/a&gt;. In that article I explained that SQL Server won&amp;rsquo;t move a page that contains an internal worktable object, and thus trying to shrink tempdb files can be futile. Today, I&amp;rsquo;m going to explain how attempting to shrink tempdb files can actually be harmful.&lt;/p&gt;</description></item><item><title>Should I install SSMS on a server running SQL Server?</title><link>https://am2.co/2020/04/14/should-i-install-ssms-on-a-server-running-sql-server/</link><pubDate>Tue, 14 Apr 2020 09:00:27 -0400</pubDate><guid>https://am2.co/2020/04/14/should-i-install-ssms-on-a-server-running-sql-server/</guid><description>&lt;p&gt;&lt;a href="https://youtu.be/jdM02PYzimU?t=40"&gt;&lt;img src="https://am2.co/wp-content/uploads/RDP.jpg" alt="" width="500" height="500" class="alignright size-full wp-image-3007" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;There&amp;rsquo;s a lot of advice out there on the internet that suggests that you should not install SSMS on your database servers running SQL Server.&lt;/p&gt;&#10;&lt;p&gt;This came up at work recently, where I was asked &amp;ldquo;Should we install SSMS on our database servers?&amp;rdquo; and my answer is:&lt;/p&gt;</description></item><item><title>When STRING_SPLIT() falls short</title><link>https://am2.co/2020/03/20/when-string_split-falls-short/</link><pubDate>Fri, 20 Mar 2020 10:00:54 -0400</pubDate><guid>https://am2.co/2020/03/20/when-string_split-falls-short/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:400px"&gt;&lt;a href="https://www.youtube.com/watch?v=vY1TQ9pb2J4"&gt;&lt;img src="https://am2.co/wp-content/uploads/STONE_SPLIT.jpg" alt="" width="400" height="300" class="size-medium wp-image-2828" /&gt;&lt;/a&gt; &lt;a href="https://twitter.com/AaronBertrand" rel="noopener noreferrer" target="_blank"&gt;Aaron&lt;/a&gt; attempting a STONE_SPLIT at a recent curling competition.&lt;/figure&gt;&#10;This morning, my friend Aaron Bertrand (&lt;a href="http://sqlblog.org" rel="noopener noreferrer" target="_blank"&gt;blog&lt;/a&gt;|&lt;a href="https://twitter.com/AaronBertrand" rel="noopener noreferrer" target="_blank"&gt;twitter&lt;/a&gt;) posted &lt;a href="https://sqlperformance.com/2020/03/t-sql-queries/please-help-string-split-improvements" rel="noopener noreferrer" target="_blank"&gt;a plea for help with &lt;code&gt;STRING_SPLIT()&lt;/code&gt; improvements&lt;/a&gt;. I'm very much in Aaron's corner on this, having &lt;a href="https://am2.co/2015/04/21/converting-delimited-values-to-a-table-efficiently/" rel="noopener noreferrer" target="_blank"&gt;written about the olden days myself&lt;/a&gt;. &#10;&lt;h3&gt;Why &lt;code&gt;STRING_SPLIT()&lt;/code&gt; is supposed to be awesome&lt;/h3&gt;&#10;CLR was fast, but inaccessible to many DBAs. XML was almost as good, but ugh, XML. And multi-statement table valued functions are evil but prevalent. &#10;&lt;p&gt;&lt;code&gt;STRING_SPLIT()&lt;/code&gt; promised to be both super fast, and lift the code maintenance problem for DBAs who don&amp;rsquo;t know .NET and struggle with the crazy XML syntax.&lt;/p&gt;</description></item><item><title>Changing a column from int to bigint, without downtime</title><link>https://am2.co/2019/12/11/changing-a-column-from-int-to-bigint-without-downtime/</link><pubDate>Wed, 11 Dec 2019 08:00:41 -0500</pubDate><guid>https://am2.co/2019/12/11/changing-a-column-from-int-to-bigint-without-downtime/</guid><description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=YHKGUu2gaOg" rel="noopener noreferrer" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/AlterOnline2.png" alt="" width="481" height="396" class="alignright size-full wp-image-2359" /&gt;&lt;/a&gt;&#10;Changing a column from &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; has gotten a lot easier since I started working on SQL Server back at the turn of the century. SQL Server 2016 introduced the ability to do &lt;code&gt;ALTER TABLE...ALTER COLUMN&lt;/code&gt; as an online operation using the &lt;code&gt;WITH (ONLINE=ON)&lt;/code&gt; syntax in Enterprise Edition. This wonderful syntax now allows you to alter a column from &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; without causing major blocking. The &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; conversion is one of the most popular data type changes I see&amp;ndash;A developer inevitably creates the table thinking they will never have more than 2 billion rows&amp;hellip; then some years or months later 2 billion becomes a reality.&lt;/p&gt;</description></item><item><title>Code to purge data based on creation date</title><link>https://am2.co/2019/04/04/code-to-purge-data-on-creation-date/</link><pubDate>Thu, 04 Apr 2019 08:30:16 -0400</pubDate><guid>https://am2.co/2019/04/04/code-to-purge-data-on-creation-date/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:678px"&gt;&lt;a href="https://www.youtube.com/watch?v=nHlJODYBLKs"&gt;&lt;img src="https://am2.co/wp-content/uploads/MarieKondoData-678x381.png" alt="" width="678" height="381" class="size-mh-magazine-lite-content wp-image-1743" /&gt;&lt;/a&gt; Only one thing can spark more joy than cleaning up old data. Doggos. &lt;/figure&gt;&#10;Yesterday, &lt;a href="https://am2.co/2019/04/03/purging-data-with-batched-deletes/"&gt;I talked about batching deletes&lt;/a&gt;, and the day before I talked about &lt;a href="https://am2.co/2019/04/02/the-thrill-of-purging-old-data/"&gt;how much I like to delete data&lt;/a&gt;, and why it's necessary to do it, despite being a data packrat.&#10;&lt;p&gt;Today, let&amp;rsquo;s look at just one scenario, and how I like to handle it. In my experience, this is one of the most common purge requirements (and probably the easiest), so first, let&amp;rsquo;s look at the business requirements.&lt;/p&gt;</description></item><item><title>The thrill of purging old data</title><link>https://am2.co/2019/04/02/the-thrill-of-purging-old-data/</link><pubDate>Tue, 02 Apr 2019 09:00:54 -0400</pubDate><guid>https://am2.co/2019/04/02/the-thrill-of-purging-old-data/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:678px"&gt;&lt;a href="https://www.youtube.com/watch?v=wdGARtyNaQQ" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://am2.co/wp-content/uploads/priscilla-du-preez-101759-unsplash-678x381.jpg" alt="" width="678" height="381" class="size-mh-magazine-lite-content wp-image-1737" /&gt;&lt;/a&gt; I get a thrill from roller coasters, but for some people it just makes them purge their lunch.&lt;/figure&gt;&#10;&lt;p&gt;DBAs &amp;amp; Data professionals tend to be digital pack rats. My personal Google Drive is filled with random files that I refused to part with&amp;ndash;even though it&amp;rsquo;s of questionable value. I lament that I do not have a copy of every paper I typed in high school or college&amp;ndash;and I envy those who do. You never know when you&amp;rsquo;ll need notes from that meeting 6 years ago, or when you&amp;rsquo;ll need that funny GIF you created for an inside joke you no longer remember.&lt;/p&gt;</description></item><item><title>Webinar: Push Your App to Enterprise Scale with Advanced SQL Server Features</title><link>https://am2.co/2018/08/20/webinar-push-your-app-to-enterprise-scale-with-advanced-sql-server-features/</link><pubDate>Mon, 20 Aug 2018 10:00:04 -0400</pubDate><guid>https://am2.co/2018/08/20/webinar-push-your-app-to-enterprise-scale-with-advanced-sql-server-features/</guid><description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=EyGuBM1ELf4"&gt;&lt;img src="https://am2.co/wp-content/uploads/SentryOneWebinar-Cropped.png" alt="" width="400" height="155" class="alignright size-medium wp-image-1636" /&gt;&lt;/a&gt;&#10;On August 28, 2018 at 2PM EDT, I&amp;rsquo;ll be joining Melissa Connors (&lt;a href="http://blogs.sqlsentry.com/author/melissaconnors/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;|&lt;a href="http://twitter.com/MelikaNoKaOi" rel="noopener" target="_blank"&gt;twitter&lt;/a&gt;), Kevin Kline (&lt;a href="http://kevinekline.com/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;|&lt;a href="https://twitter.com/kekline" rel="noopener" target="_blank"&gt;twitter&lt;/a&gt;), and Rob Sewell (&lt;a href="https://sqldbawithabeard.com/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;|&lt;a href="https://twitter.com/sqldbawithbeard" rel="noopener" target="_blank"&gt;twitter&lt;/a&gt;) for a webinar on advanced SQL Server features. The webinar centers around a real-life case study of technology SentryOne is using in it&amp;rsquo;s own database. I&amp;rsquo;ll be giving an overview of each of the features, and Melissa will cover how those features helped SentryOne boost performance. Kevin &amp;amp; Rob will be moderating&lt;/p&gt;</description></item><item><title>Performance Myths: The query result cache</title><link>https://am2.co/2018/07/23/performance-myths-the-query-result-cache/</link><pubDate>Mon, 23 Jul 2018 10:48:11 -0400</pubDate><guid>https://am2.co/2018/07/23/performance-myths-the-query-result-cache/</guid><description>&lt;img src="https://am2.co/wp-content/uploads/Myths-am-qrc-feat.png" alt="" width="850" height="130" class="alignnone size-full wp-image-2911" /&gt;&#10;&lt;p&gt;I was recently doing a training session when a developer commented that it was OK to run an expensive query twice because on the second execution, SQL Server would use the &amp;ldquo;results cache&amp;rdquo; and be &amp;ldquo;practically free&amp;rdquo;. It&amp;rsquo;s not the first time I&amp;rsquo;ve heard someone refer to a &amp;ldquo;results cache&amp;rdquo; in SQL Server. This is one of those myths that is almost true, which makes it that much more believable. If you don&amp;rsquo;t know better, you might think SQL Server has a &amp;ldquo;results cache&amp;rdquo; because the second execution of a query is often faster.&lt;/p&gt;</description></item><item><title>Alerting on SQL Server Blocking</title><link>https://am2.co/2017/12/18/alerting-sql-server-blocking/</link><pubDate>Mon, 18 Dec 2017 09:00:02 -0500</pubDate><guid>https://am2.co/2017/12/18/alerting-sql-server-blocking/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:350px"&gt;&lt;a href="https://www.youtube.com/watch?v=KLWLTs90_po"&gt;&lt;img class="wp-image-1233" src="https://am2.co/wp-content/uploads/TrafficIntersection-683x1024.jpg" alt="" width="350" height="525" /&gt;&lt;/a&gt; When blocking becomes excessive, it can cause problems. Are your blocks excessive?&lt;/figure&gt;&#10;&lt;p&gt;Identifying blocking is one of the most basic things that a DBA should be monitoring for. I previously wrote about how to &lt;a href="https://am2.co/2017/10/26/finding-leader-blocker/"&gt;identify blocking in SQL Server and find the leading blocker&lt;/a&gt;. Recently, my friend Jim Donahoe (&lt;a href="http://sqlflipflopsdba.com/" target="_blank" rel="noopener noreferrer"&gt;blog&lt;/a&gt; | &lt;a href="https://twitter.com/SQLFlipFlopsDBA" target="_blank" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;) asked me about setting up email alerts related to blocking, which prompted me to clean up some additional code I have that does just this. If you haven&amp;rsquo;t already read &lt;a href="https://am2.co/2017/10/26/finding-leader-blocker/"&gt;my previous post&lt;/a&gt;, you should probably do that now.&lt;/p&gt;</description></item><item><title>Multi-Statement TVFs in Dynamics CRM</title><link>https://am2.co/2017/08/22/multi-statement-tvfs-in-dynamics-crm/</link><pubDate>Tue, 22 Aug 2017 13:19:18 -0400</pubDate><guid>https://am2.co/2017/08/22/multi-statement-tvfs-in-dynamics-crm/</guid><description>&lt;p&gt;If you&amp;rsquo;re familiar with supporting the database behind Microsoft Dynamics CRM, you probably know that it&amp;rsquo;s not the fastest-performing database. Honestly, that shouldn&amp;rsquo;t be a surprise&amp;ndash;it&amp;rsquo;s not designed to be a screaming-fast database. It&amp;rsquo;s designed to be a &lt;em&gt;flexible&lt;/em&gt; database. Most Customer Relationship Management (CRM) systems are designed to be flexible so that they can meet the needs of many businesses in many industries with vastly different business requirements. They put those requirements ahead of database performance. That&amp;rsquo;s probably smart business, but I&amp;rsquo;m not a business person&amp;ndash;I&amp;rsquo;m a database person. My experience with Dynamics CRM is when people come to me and say&lt;/p&gt;</description></item><item><title>Blogging at SQLPerformance.com</title><link>https://am2.co/2017/03/30/guest-blogging-at-sqlperformance-com/</link><pubDate>Thu, 30 Mar 2017 09:40:00 -0400</pubDate><guid>https://am2.co/2017/03/30/guest-blogging-at-sqlperformance-com/</guid><description>&lt;p&gt;&lt;a href="https://am2.co/wp-content/uploads/SQLPerfLogo-SO.png"&gt;&lt;img class="alignright size-medium wp-image-975" src="https://am2.co/wp-content/uploads/SQLPerfLogo-SO-300x118.png" alt="" width="300" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;As part of my role on the &lt;a href="https://www.SentryOne.com" target="_blank"&gt;SentryOne&lt;/a&gt; Product Advisory Council (PAC), I&amp;rsquo;m going to occasionally be contributing posts over at &lt;a href="https://sqlperformance.com/" target="_blank"&gt;SQLPerformance.com&lt;/a&gt;. Today, my first post was published: &lt;a href="https://am2.co/2017/03/30/what-the-heck-is-a-dtu/"&gt;What the heck is a DTU?&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;SQLPerformance.com focuses on providing innovative and practical solutions for improving SQL Server performance. The site has long been a source of learning for me, and I&amp;rsquo;m incredibly excited to now be providing my own content to the site. Worry not, faithful reader! I&amp;rsquo;ll still be blogging here, at am2.co, but you can expect some of my performance-oriented posts to live over there.&lt;/p&gt;</description></item><item><title>Plan Explorer 3.0: More power and completely free</title><link>https://am2.co/2016/09/08/plan-explorer-3-0/</link><pubDate>Thu, 08 Sep 2016 11:00:04 -0400</pubDate><guid>https://am2.co/2016/09/08/plan-explorer-3-0/</guid><description>&lt;p&gt;Today, SQL Sentry &lt;a href="http://blogs.sqlsentry.com/greggonzalez/plan-explorer-pro-goes-free/" target="_blank"&gt;announced the release of Plan Explorer 3.0&lt;/a&gt;. There are a few big changes, so let&amp;rsquo;s dive right in.&lt;/p&gt;&#10;&lt;p&gt; &lt;/p&gt;&#10;&lt;h3 id="plan-explorer-just-got-free-er"&gt;Plan Explorer just got free-er&lt;/h3&gt;&#10;&lt;p&gt;&lt;img class="alignright size-full wp-image-649" src="https://am2.co/wp-content/uploads/SQLSentry-Logo-400x81.png" alt="SQLSentry-Logo-400x81" width="400" height="81" /&gt;Up until now, Plan Explorer was essentially a freemium product. There was the free edition (which was really awesome), or you could upgrade to Pro edition for some extra features (making it awesomer). With this release, everything is now included in a single edition, and it&amp;rsquo;s &lt;strong&gt;all 100% free&lt;/strong&gt;. Any feature that used to be Pro-only is now free. Multiple tabs, session history, opening deadlock files&amp;ndash;free, free, free. Any new features? You guessed it&amp;ndash;free.&lt;/p&gt;</description></item><item><title>How to shrink a database in 4 easy steps</title><link>https://am2.co/2016/04/28/shrink-database-4-easy-steps/</link><pubDate>Thu, 28 Apr 2016 11:00:22 -0400</pubDate><guid>https://am2.co/2016/04/28/shrink-database-4-easy-steps/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:238px"&gt;&lt;a href="https://www.youtube.com/watch?v=03L8u9S1vyY" rel="noopener noreferrer" target="_blank"&gt;&lt;img class="wp-image-438 size-medium" src="https://am2.co/wp-content/uploads/ShrinkyDinks-1-238x300.jpg" alt="I pity the fool who shrinks his database!" width="238" height="300" /&gt;&lt;/a&gt; I pity the fool who needs to shrink his database!&lt;/figure&gt;&#10;&lt;p&gt;It&amp;rsquo;s a really common question: &amp;ldquo;How do I shrink my database?&amp;rdquo;&#10;Luckily, there&amp;rsquo;s also a really common answer: &amp;ldquo;Don&amp;rsquo;t.&amp;rdquo;&lt;/p&gt;&#10;&lt;h3 id="but-what-if-you-really-have-to"&gt;&amp;hellip;but what if you really have to?&lt;/h3&gt;&#10;&lt;p&gt;Perhaps you just implemented &lt;a href="https://am2.co/category/data-compression/"&gt;data compression&lt;/a&gt;, and have 60% free space in your database.&#10;Perhaps you just deleted a bunch of old data, and have significant free space in your database.&#10;There are a handful of scenarios where you have free space in the database, you&amp;rsquo;ll never use it, and you need to shrink. Just don&amp;rsquo;t make a habit of it.&lt;/p&gt;</description></item><item><title>How fast queries hurt performance</title><link>https://am2.co/2016/04/15/fast-queries-hurt/</link><pubDate>Fri, 15 Apr 2016 12:36:16 -0400</pubDate><guid>https://am2.co/2016/04/15/fast-queries-hurt/</guid><description>&lt;p&gt;This week at work, I noticed CPU on one server seemed pretty high. I wasn&amp;rsquo;t familiar with this particular server, but based on the applications it supported, I was expecting the server to be under-utilized. I went over to vCenter to look at historical CPU performance, and see if high CPU was normal. When I looked at 30-day CPU usage, what I saw was alarming:&lt;/p&gt;</description></item><item><title>Converting delimited values to a table (efficiently?)</title><link>https://am2.co/2015/04/21/converting-delimited-values-to-a-table-efficiently/</link><pubDate>Tue, 21 Apr 2015 15:33:00 -0400</pubDate><guid>https://am2.co/2015/04/21/converting-delimited-values-to-a-table-efficiently/</guid><description>&lt;p&gt;This is a pretty common problem. I think it&amp;rsquo;s a question every developer has asked at one time or another: &amp;ldquo;I want to pass in a comma-separated list of values, then convert it into a table.&amp;quot;&lt;br /&gt;&lt;br /&gt;Every company I&amp;rsquo;ve ever worked for has had a function that does this. Everyone does it differently. It&amp;rsquo;s never efficient. I&amp;rsquo;ve seen it done in CLR, I&amp;rsquo;ve seen it done as a multi-statement table-valued user-defined function (which we all know is the devil&amp;rsquo;s work). The CLR works, but it&amp;rsquo;s a black-box to the average DBA or SQL developer. The multi-statement TVF performs terribly, but has never been used heavily enough to make it to the top of my tuning list. &lt;br /&gt;&lt;br /&gt;This morning, I saw Pinal Dave (&lt;a href="https://twitter.com/pinaldave" target="_blank" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;|&lt;a href="http://blog.sqlauthority.com/" target="_blank" rel="noopener noreferrer"&gt;blog&lt;/a&gt;) &lt;a href="http://blog.sqlauthority.com/2015/04/21/sql-server-split-comma-separated-list-without-using-a-function/" target="_blank" rel="noopener noreferrer"&gt;post on his blog&lt;/a&gt; about this topic, and he used a really elegant XML-based solution. It&amp;rsquo;s one of those solutions that&amp;rsquo;s so simple, it&amp;rsquo;s incredibly hard.&lt;br /&gt;&lt;br /&gt;When I got to my desk this morning, I immediately wrapped Pinal&amp;rsquo;s code into a function that was backwards compatible to a multi-statement TVF version and performance tested them head-to-head.&lt;br /&gt;&lt;br /&gt;Here&amp;rsquo;s my function definition:&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>