<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlcat.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQLCAT Blogs</title><link>http://sqlcat.com/msdnmirror/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20910.1126)</generator><item><title>How to Enable RCSI for a Database with Database Mirroring</title><link>http://sqlcat.com/msdnmirror/archive/2010/03/16/how-to-enable-rcsi-for-a-database-with-database-mirroring.aspx</link><pubDate>Tue, 16 Mar 2010 21:36:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1134</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1134</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2010/03/16/how-to-enable-rcsi-for-a-database-with-database-mirroring.aspx#comments</comments><description>Author: Sanjay Mishra Reviewers: Prem Mehra, Alexei Khalyako, Kun Cheng, Mike Ruthruff, Thomas Kejser, Sunil Agarwal To enable read committed snapshot isolation (RCSI) on a database, one needs to execute the following command: ALTER DATABASE &amp;lt;db_name&amp;gt;...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2010/03/16/how-to-enable-rcsi-for-a-database-with-database-mirroring.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1134" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/database+mirroring/default.aspx">database mirroring</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/DBM/default.aspx">DBM</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/read+committed+snapshot+isolation/default.aspx">read committed snapshot isolation</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/RCSI/default.aspx">RCSI</category></item><item><title>Enabling Partition Level Locking in SQL Server 2008</title><link>http://sqlcat.com/msdnmirror/archive/2010/03/03/enabling-partition-level-locking-in-sql-server-2008.aspx</link><pubDate>Wed, 03 Mar 2010 23:54:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1124</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1124</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2010/03/03/enabling-partition-level-locking-in-sql-server-2008.aspx#comments</comments><description>Author: Thomas Kejser Reviewers: Juergen Thomas, Sanjay Mishra, Stuart Ozer, Lubor Kollar, Kevin Cox, Kun Cheng In this blog, we will provide additional details on a well-hidden feature in SQL Server 2008 – partition-level locking. But before we illustrate...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2010/03/03/enabling-partition-level-locking-in-sql-server-2008.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1124" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/Data+Warehouse/default.aspx">Data Warehouse</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/sql/default.aspx">sql</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/Partitioning/default.aspx">Partitioning</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>SQL Server 2008 R2 UNICODE Compression – what happens in the background?</title><link>http://sqlcat.com/msdnmirror/archive/2010/03/02/sql-server-2008-r2-unicode-compression-what-happens-in-the-background.aspx</link><pubDate>Wed, 03 Mar 2010 00:06:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1122</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1122</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2010/03/02/sql-server-2008-r2-unicode-compression-what-happens-in-the-background.aspx#comments</comments><description>SQL Server 2008 R2 added a much requested feature: Unicode compression. It addresses the need to compress Unicode strings. It is implemented as part of ROW compression, which was added in SQL 2008. That is; if ROW compression (on SQL 2008 R2) is enabled...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2010/03/02/sql-server-2008-r2-unicode-compression-what-happens-in-the-background.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1122" width="1" height="1"&gt;</description></item><item><title>Performance tips of using XML data in SQL Server</title><link>http://sqlcat.com/msdnmirror/archive/2010/03/01/performance-tips-of-using-xml-data-in-sql-server.aspx</link><pubDate>Mon, 01 Mar 2010 23:52:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1121</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1121</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2010/03/01/performance-tips-of-using-xml-data-in-sql-server.aspx#comments</comments><description>Author: Kun Cheng Reviewers: Peter Carlin, Mike Ruthruff, Thomas Kejser, Nicholas Dritsas XML data type is usually used to store semi-structured data with great flexibility and query capabilities. It’s a good choice for developing platform agnostic applications...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2010/03/01/performance-tips-of-using-xml-data-in-sql-server.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1121" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/XML/default.aspx">XML</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/Index/default.aspx">Index</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/XPath/default.aspx">XPath</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/XQuery/default.aspx">XQuery</category></item><item><title>Full Text Indexing Terabytes of Files with SQL Server and Cloud Storage</title><link>http://sqlcat.com/msdnmirror/archive/2010/02/02/full-text-indexing-terabytes-of-files-with-sql-server-and-cloud-storage.aspx</link><pubDate>Wed, 03 Feb 2010 02:52:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1071</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1071</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2010/02/02/full-text-indexing-terabytes-of-files-with-sql-server-and-cloud-storage.aspx#comments</comments><description>Author: Darko Sancanin, Nicholas Dritsas Reviewers and contributors: Lubor Kollar, Stuart Ozer, Michael Thomassy Business Case There are currently over 50 million files (over 10 Terabytes of data) that the customer is migrating into a custom project management...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2010/02/02/full-text-indexing-terabytes-of-files-with-sql-server-and-cloud-storage.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1071" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/Full+Text+Search/default.aspx">Full Text Search</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/cloud+storage/default.aspx">cloud storage</category></item><item><title>Whitepaper About Star Join Optimizations</title><link>http://sqlcat.com/msdnmirror/archive/2009/12/16/whitepaper-about-star-join-optimizations.aspx</link><pubDate>Wed, 16 Dec 2009 20:20:03 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1027</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1027</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/12/16/whitepaper-about-star-join-optimizations.aspx#comments</comments><description>When we talk to Data Warehouse customers – they often raise questions about the star joins improvements SQL Server 2008. Star join is a set of optimizations that provide some interesting performance gains in data warehouse workload. Instead of digging...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/12/16/whitepaper-about-star-join-optimizations.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1027" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/Data+Warehouse/default.aspx">Data Warehouse</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/sql/default.aspx">sql</category></item><item><title>Monitoring free space in tempdb transaction log</title><link>http://sqlcat.com/msdnmirror/archive/2009/12/14/monitoring-free-space-in-tempdb-transaction-log.aspx</link><pubDate>Mon, 14 Dec 2009 13:58:36 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1025</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1025</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/12/14/monitoring-free-space-in-tempdb-transaction-log.aspx#comments</comments><description>Author: Thomas Kejser Reviewers: Peter Byrne, Sunil Agarwal, Prem Mehra, Peter Scharlock, Lindsey Allen, Mark Souza As part of your database monitoring, you may be keeping track of the free space in the transaction log. One reason to do this, is to detect...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/12/14/monitoring-free-space-in-tempdb-transaction-log.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1025" width="1" height="1"&gt;</description></item><item><title>Performance Comparison between Data Type Conversion Techniques in SSIS 2008</title><link>http://sqlcat.com/msdnmirror/archive/2009/12/01/performance-comparison-between-data-type-conversion-techniques-in-ssis-2008.aspx</link><pubDate>Tue, 01 Dec 2009 13:59:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1022</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1022</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/12/01/performance-comparison-between-data-type-conversion-techniques-in-ssis-2008.aspx#comments</comments><description>Authors : Sedat Yogurtcuoglu and Thomas Kejser Technical Reviewers : Kevin Cox, Denny Lee, Carl Rabeler, Dana Kaufman, Jesse Fountain, Alexei Khalyako, Dana Kaufman Overview Data type conversion is one of the most common ETL tasks used in Microsoft® SQL...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/12/01/performance-comparison-between-data-type-conversion-techniques-in-ssis-2008.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1022" width="1" height="1"&gt;</description></item><item><title>PowerPivot for SharePoint Installation Guides DRAFT</title><link>http://sqlcat.com/msdnmirror/archive/2009/11/20/powerpivot-for-sharepoint-installation-guides-draft.aspx</link><pubDate>Fri, 20 Nov 2009 15:18:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:1009</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=1009</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/11/20/powerpivot-for-sharepoint-installation-guides-draft.aspx#comments</comments><description>The installation of PowerPivot for SharePoint can be a little complex at times - especially the PowerPivot for SharePoint multi-server farm scenario. In order to help with this, the Analysis Services team and the SQLCAT team came together and created...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/11/20/powerpivot-for-sharepoint-installation-guides-draft.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=1009" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/PowerPivot/default.aspx">PowerPivot</category></item><item><title>PowerPivot Jump Start!</title><link>http://sqlcat.com/msdnmirror/archive/2009/11/10/powerpivot-jump-start.aspx</link><pubDate>Tue, 10 Nov 2009 23:41:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:996</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=996</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/11/10/powerpivot-jump-start.aspx#comments</comments><description>As you may already know, the new name for Project Gemini is PowerPivot and the official names are PowerPivot for Excel and PowerPivot for SharePoint. For information and to sign up for notification on the release dates, check out the official PowerPivot...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/11/10/powerpivot-jump-start.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=996" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/PowerPivot/default.aspx">PowerPivot</category></item><item><title>Using Filtered Statistics with Partitioned Tables.</title><link>http://sqlcat.com/msdnmirror/archive/2009/10/20/using-filtered-statistics-with-partitioned-tables.aspx</link><pubDate>Tue, 20 Oct 2009 20:26:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:951</guid><dc:creator>AlexeiK</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=951</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/10/20/using-filtered-statistics-with-partitioned-tables.aspx#comments</comments><description>&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;Author:&lt;/b&gt; Alexei Khalyako&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&lt;b&gt;Reviewers and contributors:&lt;/b&gt; Eric Hanson, Dimitri Artemov, Burzin Patel, Thomas Kejser&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Introduction&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;We’ve worked with a customer on architectural design review and preparing a migration of a big &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Data Warehouse from SQL Server 2005 to SQL Server 2008.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Base on the customer’s requests, there were various advantages of the migration to SQL Server 2008 identified. One of the requests was related to control of the query resource consumption. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;The main role of the Data Warehouse in the customer’s scenario&amp;nbsp; is to collect Call Data records, which have to be analyzed later and used by several other business applications. So, in general once per day new data come into a several Terabyte partitioned table and then business apps and business users were running report-type of queries. Some of the relatively small reports were taking very long times. As DBA started analyzing those queries they recognized that the difference between REQUIRED and REQUESTED memory by the query was huge (like amount of required memory was 18Mb and requested – 10 GB)!&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;As the part of optimization we were able to lower the appetite of those queries by using Resource Governor. We even managed to get more of the heavy queries executed at the same time. However this didn’t address the other question – why queries were requesting way more memory?&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;Analyzing query plans we found out that the Statistics were disabled on this table. The reason for this was that customer had to load every day very big amount of data into the new partition. Statics was becoming not valid and should have been updated.&amp;nbsp; Update process was starting on the entire table (which is several Tb) and by the tome update was finished – the new portion of the data was arriving. And so on, and so on... Customer decided to disable and delete statistics on the entire table.&lt;br /&gt;Another important moment to note: customer stated that most of the report queries run against only one partition in partitioned table.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;Base on the AdwentureWorks database and the table SalesOrderHeader I created a little sample to illustrate this situation. I made a partitioned table SalesOrderHistory partitioned by OrderDate by date and covering one month 2008-07.&lt;br /&gt;The table structure looks like:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;font color="#000000" face="Calibri" size="3"&gt;CREATE TABLE [SalesOrderHistory](&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SalesOrderID] [int]&amp;nbsp; NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [RevisionNumber] [tinyint] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OrderDate] [datetime] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;[DueDate] [datetime] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ShipDate] [datetime] NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Status] [tinyint] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SalesOrderNumber]&amp;nbsp; [nvarchar](25) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CustomerID] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ShipToAddressID] [int] NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [BillToAddressID] [int] NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CreditCardApprovalCode] [varchar](15) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SubTotal] [money] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TaxAmt] [money] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Freight] [money] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TotalDue]&amp;nbsp; [money] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;[Comment] [nvarchar](max) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [rowguid] [uniqueidentifier] ROWGUIDCOL&amp;nbsp; NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ModifiedDate] [datetime] NOT NULL)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON day_scheme ([OrderDate])&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;span style="color:gray;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;The query will look like a:&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;Select&amp;nbsp; b.Name, a.SalesorderId, a.OrderDate from SalesOrderHistory a&lt;br /&gt;Inner Join Store b on a.CustomerID = b.CustomerID&lt;br /&gt;WHERE a.OrderDate = &amp;#39;2008-07-13 00:00:00.000&amp;#39;and a.SalesOrderID = 43659&lt;br /&gt;Group by b.Name, a.SalesorderId, a.OrderDate&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;Query executed in 5 sec.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Let’s see the plan with no statistics on the table:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;img src="http://sqlcat.com/photos/sample/images/953/original.aspx" style="width:700px;height:241px;" alt="" width="1061" align="left" border="0" height="272" /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;
&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;So, we see the warning that statistics is missing, if we check the estimated number of rows in the output of SELECT is 393 rows&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;img src="http://sqlcat.com/photos/sample/images/954/original.aspx" style="width:683px;height:451px;" alt="" width="1101" align="left" border="0" height="626" /&gt;&lt;img src="http://sqlcat.com/photos/sample/images/954/original.aspx" alt="" width="1" border="0" height="1" /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&lt;img src="http://sqlcat.com/photos/sample/images/955/original.aspx" style="width:674px;height:432px;" alt="" width="914" align="left" border="0" height="451" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;If we run DMV to check memory requested and granted to this query we will see following:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;select&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; session_id&lt;span style="color:gray;"&gt;,&lt;/span&gt;requested_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;required_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;granted_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;query_cost&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;from&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;span style="color:green;"&gt;sys&lt;/span&gt;&lt;span style="color:gray;"&gt;.&lt;/span&gt;&lt;span style="color:green;"&gt;dm_exec_query_memory_grants&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;where&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; session_id &lt;span style="color:gray;"&gt;&amp;gt;&lt;/span&gt;50&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp; 
&lt;/p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;table style="margin:auto auto auto 2.85pt;width:400.3pt;border-collapse:collapse;" class="MsoNormalTable" cellpadding="0" cellspacing="0"&gt;

&lt;tr style="height:15pt;"&gt;
&lt;td style="border:1pt solid windowtext;padding:0cm 3.5pt;background-color:transparent;width:48pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;session_id&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:106.3pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;requested_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:99.2pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;required_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:95.7pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;granted_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:51.1pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;query_cost&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="height:15pt;"&gt;
&lt;td style="border-width:medium 1pt 1pt;border-style:none solid solid;padding:0cm 3.5pt;background-color:transparent;width:48pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;52&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:106.3pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:red;"&gt;&lt;font face="Calibri"&gt;1360&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:99.2pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:red;"&gt;&lt;font face="Calibri"&gt;1280&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:95.7pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;1360&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:51.1pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;5,737777&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Now we will try to fix it. In SQL 2008 we’ve got new Filtered Statistics. In order to learn more about this feature please read &lt;a href="http://msdn.microsoft.com/en-us/library/ms190397.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms190397.aspx&lt;/a&gt;&amp;nbsp;Having in mind that customer told us that 80% of the queries are hitting only one partition we may apply filtered statistics to improve those queries performance.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;I can try to create different statistics per each column which is included in SELECT statement:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;span style="color:blue;"&gt;STATISTICS&lt;/span&gt; Day0713_SalesOrderID &lt;span style="color:blue;"&gt;on&lt;/span&gt; SalesOrderHistory&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;SalesOrderID &lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;where&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OrderDate &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;2008-07-13 00:00:00.000&amp;#39;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;span style="color:blue;"&gt;STATISTICS&lt;/span&gt; Day0713_OrderDate &lt;span style="color:blue;"&gt;on&lt;/span&gt; SalesOrderHistory&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;OrderDate&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:blue;"&gt;where&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OrderDate &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;2008-07-13 00:00:00.000&amp;#39;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;span style="color:blue;"&gt;STATISTICS&lt;/span&gt; Day0713_CustomerID &lt;span style="color:blue;"&gt;on&lt;/span&gt; SalesOrderHistory&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;CustomerID &lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:blue;"&gt;where&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OrderDate &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;2008-07-13 00:00:00.000&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;After creating those statistics and executing the same query as mentioned above we see that the query execution time was few milliseconds and the plan looked much better:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;img src="http://sqlcat.com/photos/sample/images/956/original.aspx" style="width:681px;height:409px;" alt="" width="588" align="left" border="0" height="364" /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Let’s check how much memory this query requested now and how much was granted:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;select&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; session_id&lt;span style="color:gray;"&gt;,&lt;/span&gt;requested_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;required_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;granted_memory_kb&lt;span style="color:gray;"&gt;,&lt;/span&gt;query_cost&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;from&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; &lt;span style="color:green;"&gt;sys&lt;/span&gt;&lt;span style="color:gray;"&gt;.&lt;/span&gt;&lt;span style="color:green;"&gt;dm_exec_query_memory_grants&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;"&gt;where&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt; session_id &lt;span style="color:gray;"&gt;&amp;gt;&lt;/span&gt;50&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;/p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;&lt;/span&gt;&lt;table style="margin:auto auto auto 2.85pt;width:407.9pt;border-collapse:collapse;" class="MsoNormalTable" cellpadding="0" cellspacing="0"&gt;

&lt;tr style="height:15pt;"&gt;
&lt;td style="border:1pt solid windowtext;padding:0cm 3.5pt;background-color:transparent;width:48.65pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;session_id&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:108.35pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;requested_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:101.25pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;required_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:97.65pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;granted_memory_kb&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:1pt 1pt 1pt medium;border-style:solid solid solid none;padding:0cm 3.5pt;background-color:transparent;width:52pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;query_cost&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="height:15pt;"&gt;
&lt;td style="border-width:medium 1pt 1pt;border-style:none solid solid;padding:0cm 3.5pt;background-color:transparent;width:48.65pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;52&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:108.35pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;1024&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:101.25pt;height:15pt;"&gt;&lt;b&gt;&lt;span style="color:red;"&gt;&lt;font face="Calibri"&gt;512&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:97.65pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;1024&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-width:medium 1pt 1pt medium;border-style:none solid solid none;padding:0cm 3.5pt;background-color:transparent;width:52pt;height:15pt;"&gt;&lt;span style="color:black;"&gt;&lt;font face="Calibri"&gt;5,678132&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;We see that comparable to running the same query with no statistics now with filtered statistics on the table enabled has the query much lower expectations on how much memory it may need.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;One of the great advantages of the filtered statistics is that if we switch in new partition into the partitioned table filtered statistics built on the older partitions does not become invalid and you don’t need to update it. You only need to create new filtered statistics for the new partition which is much faster process comparable to if you need to update or build statistics for entire table.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;In case of the real data in the customer’s lab we were able to get even better results using filtered statistics on much bigger amount of data. If you have similar workload, where most of the queries are going against single partition in partitioned table you may want to play with the filtered indexes and check if it will help you increasing performance of your queries. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=951" width="1" height="1"&gt;</description></item><item><title>Are you going to SQL PASS Nov. 3rd- Nov. 5th?</title><link>http://sqlcat.com/msdnmirror/archive/2009/10/19/are-you-going-to-sql-pass-nov-3rd-nov-5th.aspx</link><pubDate>Mon, 19 Oct 2009 13:47:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:950</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=950</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/10/19/are-you-going-to-sql-pass-nov-3rd-nov-5th.aspx#comments</comments><description>Are you going to SQLPASS in Seattle on Nov 3 rd -Nov 5 th ? If you are going or even thinking about it, then read about how you can spend some quality time with the SQLCAT team. We will be there with our famous ugly lime green shirts, so you won’t miss...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/10/19/are-you-going-to-sql-pass-nov-3rd-nov-5th.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=950" width="1" height="1"&gt;</description></item><item><title>Looking deeper into SQL Server using Minidumps</title><link>http://sqlcat.com/msdnmirror/archive/2009/09/11/looking-deeper-into-sql-server-using-minidumps.aspx</link><pubDate>Fri, 11 Sep 2009 15:43:24 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:903</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=903</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/09/11/looking-deeper-into-sql-server-using-minidumps.aspx#comments</comments><description>Author: Thomas Kejser Reviewers and Contributors: Bob Ward, Michael Thomassy, Juergen Thomas, Hermann Daeubler, Mark Souza, Lubor Kollar, Henk van der Valk (Unisys) and Peter Scharlock For advanced troubleshooting and understanding of SQL Server, you...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/09/11/looking-deeper-into-sql-server-using-minidumps.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=903" width="1" height="1"&gt;</description></item><item><title>Using HierarchyID in SQL Server</title><link>http://sqlcat.com/msdnmirror/archive/2009/08/27/using-hierarchyid-in-sql-server.aspx</link><pubDate>Thu, 27 Aug 2009 14:48:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:895</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=895</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/08/27/using-hierarchyid-in-sql-server.aspx#comments</comments><description>Implementing a hierarchy structure in a relational data base normally takes a bit of work. The new SQL Server data type for hierarchyID gives a good shortcut to the old methods, makes it faster to get a solution in place and makes it much easier to maintain...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/08/27/using-hierarchyid-in-sql-server.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=895" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/Development+_2600_amp_3B00_+Programming/default.aspx">Development &amp;amp; Programming</category></item><item><title>Gemini - Self Service BI!</title><link>http://sqlcat.com/msdnmirror/archive/2009/08/15/gemini-self-service-bi.aspx</link><pubDate>Sun, 16 Aug 2009 00:25:00 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:893</guid><dc:creator>Microsoft SQL Server Development Customer Advisory Team</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlcat.com/msdnmirror/rsscomments.aspx?PostID=893</wfw:commentRss><comments>http://sqlcat.com/msdnmirror/archive/2009/08/15/gemini-self-service-bi.aspx#comments</comments><description>Gemini is the code name for the new breakthrough Self-Service Business Intelligence (BI) capabilities being delivered in the SQL Server 2008 R2 release. Gemini enables end users to build BI applications by integrating data from a variety of sources, modeling...(&lt;a href="http://sqlcat.com/msdnmirror/archive/2009/08/15/gemini-self-service-bi.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=893" width="1" height="1"&gt;</description><category domain="http://sqlcat.com/msdnmirror/archive/tags/BI/default.aspx">BI</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/analysis+services/default.aspx">analysis services</category><category domain="http://sqlcat.com/msdnmirror/archive/tags/Gemini/default.aspx">Gemini</category></item></channel></rss>