{"id":579,"date":"2010-04-01T08:00:47","date_gmt":"2010-04-01T06:00:47","guid":{"rendered":"https:\/\/www.sqlinthewild.co.za\/?p=579"},"modified":"2015-08-03T20:15:35","modified_gmt":"2015-08-03T18:15:35","slug":"running-sql-faster","status":"publish","type":"post","link":"https:\/\/www.sqlinthewild.co.za\/index.php\/2010\/04\/01\/running-sql-faster\/","title":{"rendered":"Running SQL faster"},"content":{"rendered":"<p>Poor performance is not uncommon in most SQL Server environments. The data sizes are growing, the hardware isn&#8217;t and traditional methods of performance tuning are time-consuming and difficult.<\/p>\n<p>So what&#8217;s the solution? Well, throwing hardware at the problem is an old favourite. There are few workloads that a nice 256-processor Itanium with a terabyte or two of memory won&#8217;t handle, but servers like that are a little on the expensive side and lots of money spent on expensive hardware means less that can be spent on annual bonuses.<\/p>\n<p>There is another option, a hidden, undocumented option that can improve query performance, maybe a little, maybe substantially.<\/p>\n<p>First thing that you need to do to get this one is to enable the hidden options in sp_configure. This is done much the same way as the advanced options.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">exec sp_configure 'show hidden options', 1\r\nRECONFIGURE WITH EXTREME OVERRIDE<\/pre>\n<p>Once that&#8217;s done, the undocumented option can be enabled.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">exec sp_configure 'run queries faster', 101010\r\n RECONFIGURE WITH EXTREME OVERRIDE<\/pre>\n<p>How much improvement this will give depends on the kind of queries being run. OLTP systems usually see a greater improvement than decision-support, unless there&#8217;s full text search or spatial queries, in which case there will likely be substantially less of a gain.<\/p>\n<p>Now, there are a few things to consider.<\/p>\n<ol>\n<li>This is obviously undocumented and that means unsupported.<\/li>\n<li>It may not work on the next version of SQL.<\/li>\n<li>If you call support, disable the option first and <strong>don&#8217;t tell them you were running it!<\/strong><\/li>\n<\/ol>\n<p>.<\/p>\n<p>Happy <a href=\"http:\/\/en.wikipedia.org\/wiki\/April_fools_day\">April Fools&#8217; day<\/a>.<\/p>\n<p>.<\/p>\n<p>..<\/p>\n<p>&#8230;<\/p>\n<p>&#8230;.<\/p>\n<p>Seriously now, there&#8217;s no options that, when enabled, makes SQL run queries faster. There is no silver bullet for performance problems, there is no one-size-fits-all fix.<\/p>\n<p>Fixing performance problems involves finding the current bottleneck and removing it, then repeating that operation until performance is acceptable. It&#8217;s a complex area and there&#8217;s a lot to it. Simply throwing hardware at the problem may not produce much, if any, performance gain, especially if the hardware wasn&#8217;t the bottleneck.<\/p>\n<p>If you have a query performance problem and don&#8217;t know where to start, ask on one of the SQL forums (like <a href=\"http:\/\/www.sqlservercentral.com\/\">SQLServerCentral<\/a>) if it&#8217;s not an urgent problem. If it is, or if there are serious problems, consider getting a consultant in to help out. One of the quickest ways to learn is to learn from someone who knows what they are doing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Poor performance is not uncommon in most SQL Server environments. The data sizes are growing, the hardware isn&#8217;t and traditional methods of performance tuning are time-consuming and difficult. So what&#8217;s the solution? Well, throwing hardware at the problem is an&#8230; <a class=\"read-more-button\" href=\"https:\/\/www.sqlinthewild.co.za\/index.php\/2010\/04\/01\/running-sql-faster\/\">(Read more)<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7h6n-9l","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":1573,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/579\/revisions\/1573"}],"wp:attachment":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}