<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.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>Search results matching tag 'columnstore'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=columnstore&amp;orTags=0</link><description>Search results matching tag 'columnstore'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Bleeding Edge 2012 – session material</title><link>http://sqlblog.com/blogs/hugo_kornelis/archive/2012/10/27/bleeding-edge-2012-session-material.aspx</link><pubDate>Sat, 27 Oct 2012 10:46:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45812</guid><dc:creator>Hugo Kornelis</dc:creator><description>&lt;p&gt;As promised, here are the slide deck and demo code I used for my presentation at the &lt;a href="http://www.bleedingedge.si/Conference"&gt;Bleeding Edge 2012 conference&lt;/a&gt; in Laško, Slovenia. Okay, I promised to have them up by Tuesday or Wednesday at worst, and it is now Saturday – my apologies for the delay.&lt;/p&gt;  &lt;p&gt;Thanks again to all the attendees of my session. I hope you enjoyed it, and if you have any question then please don’t hesitate to get in touch with me.&lt;/p&gt;  &lt;p&gt;I had a great time in Slovenia, both during the event and in the after hours. Even if everything the tour guide said during the tour of the Laško brewery was lost on me (in his defense, he &lt;i&gt;did&lt;/i&gt; offer to translate the Slovenian explanations to Russian), I still liked it – especially the part where we got to sample some of the produce!&lt;/p&gt;  &lt;p&gt;I truly hope that there will be another Bleeding Edge conference next year. And if there is, I definitely want to speak there again!&lt;/p&gt;</description></item><item><title>Geek City: Build a Big Table with a Columnstore Index</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/04/26/Build-a-Big-Table-with-a-Columnstore-Index.aspx</link><pubDate>Thu, 26 Apr 2012 18:18:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43013</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;I was looking all over to find a big table to use for my columnstore 
examples in my SQL Server 2012 book, and the only one I found was from someone 
at Microsoft and was not publicly available.  When I demonstrate code in my 
writings, I like to have the code available for anyone to use, so that was no 
use. &lt;/p&gt;
&lt;p&gt;Finally I realized I was just going to have to do it myself. I actually based 
the script on some work by the awesome Benjamin Nevarez (&lt;a href="http://www.benjaminnevarez.com/"&gt;blog&lt;/a&gt;| &lt;a href="http://twitter.com/BenjaminNevarez"&gt;twitter&lt;/a&gt;), but I needed to make a 
couple of changes to the table structure, and then the loop for adding the data 
took some tweeking to make sure that uniqueness was possible, in case you need 
to test out how the metadata changes when a columnstore index is built on a 
table with a unique clustered index compared to a nonunique clustered index 
compared to a heap. &lt;/p&gt;
&lt;p&gt;I have just finished the chapter on indexes, and decided to make this script 
available. The initial table data is based on the data in Microsoft 
AdventureWorksDW2012 sample database that you can download &lt;a href="http://msftdbprodsamples.codeplex.com/releases/view/55330"&gt;here&lt;/a&gt;.  
(Note that the DW version is the first one under “Other Available Downloads”’; 
it’s not the one under “Recommended Download”. )&lt;/p&gt;
&lt;p&gt;Here is the section of the script that populates most of the 
&lt;em&gt;FactInternetSalesBIG&lt;/em&gt; table. (The original 60K rows were just copied 
from the original &lt;em&gt;FactInternetSales&lt;/em&gt; table. Note that all the statements 
have to be run in a single batch because the local variable’s scope is the 
batch, and because the GO 9 applies to the single batch that precedes it. Of 
course, you can change the number of iterations to end up with a different size 
table. Mine ends up at just over 30 million rows.  In addition to modifying the 
&lt;em&gt;SalesOrderNumber&lt;/em&gt; value on each iteration, I also changed the value of the 
Revision column to indicate which pass through the insert loop was being 
executed. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;br&gt;&lt;font size="2" face="Courier New"&gt;&lt;br&gt;-- Copy the new big table into itself 
9 times&lt;br&gt;DECLARE @RevisionNumber nchar(2);&lt;br&gt;SELECT @RevisionNumber = 
RevisionNumber + 1 FROM RevisionNumberValue;&lt;br&gt;SELECT @RevisionNumber as 
RevisionNumber;&lt;br&gt;INSERT INTO dbo.FactInternetSalesBig WITH (TABLOCK)&lt;br&gt;    
SELECT ProductKey&lt;br&gt;      ,OrderDateKey&lt;br&gt;      ,DueDateKey&lt;br&gt;      
,ShipDateKey&lt;br&gt;      ,CustomerKey&lt;br&gt;      ,PromotionKey&lt;br&gt;      
,CurrencyKey&lt;br&gt;      ,SalesTerritoryKey&lt;br&gt;      ,SalesOrderNumber + 
@RevisionNumber&lt;br&gt;      ,SalesOrderLineNumber&lt;br&gt;      
,@RevisionNumber&lt;br&gt;      ,OrderQuantity&lt;br&gt;      ,UnitPrice&lt;br&gt;      
,ExtendedAmount&lt;br&gt;      ,UnitPriceDiscountPct&lt;br&gt;      ,DiscountAmount&lt;br&gt;      
,ProductStandardCost&lt;br&gt;      ,TotalProductCost&lt;br&gt;      ,SalesAmount&lt;br&gt;      
,TaxAmt&lt;br&gt;      ,Freight&lt;br&gt;      ,CarrierTrackingNumber&lt;br&gt;      
,CustomerPONumber &lt;br&gt;      ,OrderDate&lt;br&gt;      ,DueDate&lt;br&gt;      ,ShipDate&lt;br&gt;  
FROM dbo.FactInternetSalesBig;&lt;br&gt;  UPDATE RevisionNumberValue SET 
RevisionNumber = RevisionNumber + 1;&lt;br&gt;GO 9&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Make sure you have enough log space. My log grew from 1GB to just over 8GB 
when running the script to build the 30 million row table and columnstore index, 
with no clustered index.  &lt;/p&gt;
&lt;p&gt;The downloadable script has commented options to build either a clustered or  
nonclustered index before you build the columnstore index. I suggest building 
the clustered index before the columnstore index,  because building the 
clustered index&amp;nbsp;will rebuild any existing nonclustered indexes, including my 
columnstore index. Building the columnstore index can take a while, on my system 
it was about 10 minutes. (Building the original 30+ million row table took even longer.)&lt;/p&gt;&lt;p&gt;After I finish the chapter on partitioning, I'll have a script to partition this table, but feel free to do that yourself!&lt;/p&gt;
&lt;p&gt;Have fun!&lt;/p&gt;
&lt;p&gt;&lt;font color="#d16349" size="4"&gt;~Kalen&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Slides and demo code for Columnstore Index session</title><link>http://sqlblog.com/blogs/hugo_kornelis/archive/2012/04/04/slides-and-demo-code-for-columnstore-index-session.aspx</link><pubDate>Wed, 04 Apr 2012 20:58:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:42695</guid><dc:creator>Hugo Kornelis</dc:creator><description>&lt;p&gt;Almost a week has passed after &lt;a href="http://sqlbits.com/"&gt;SQLBits X in London&lt;/a&gt;, so I guess it’s about time for me to share the slides and demo code of my session on columnstore indexes. After all, I promised people I would do that – especially when I found out that I had enough demos prepared to fill two sessions!&lt;/p&gt;  &lt;p&gt;I made some changes to the demo code. I added extra comments, not only to the demos I could not explain and run during the session, but also to the rest, so that people who missed the session will also be able to benefit. I also found and fixed the error that caused one of my demos to fail. It turned out to be as embarrassing as it was unspectacular – somewhere along the way, I must have accidentally fat-fingered the backspace button while the cursor was on the name of an index. And if the index name doesn’t match, queries against index-related DMVs tend to produce no results. &amp;lt;sigh&amp;gt;&lt;/p&gt;  &lt;p&gt;After fixing this typo, I re-ran all demos and they now worked flawlessly.&lt;/p&gt;  &lt;p&gt;One major catch (and those who were in my session already know this). I ran my demos on a database that I got from within Microsoft, and I have no permission to redistribute this database. That means that people can only study the code, but not run it – well, okay, they &lt;i&gt;can&lt;/i&gt; run it, on the “small” version of the database and table (change database names AdventureWorks2008DWXL and AdventureWorks2008DWBig to AdventureWorks2008DW, and change table names FactResellerSalesXL and FactResellerSalesPart to FactResellerSales), but with the size of that table, I expect the optimizer to make completely different choices for the execution plans. So while you can’t see the actual performance benefit by running the code yourself, you can still learn the patterns to use to work around the many limitations of columnstore indexes and batch mode.&lt;/p&gt;  &lt;p&gt;I normally prefer to use demo code that any attendee can replicate on their own test databases, but in this case, I simply did not have the time to make a &lt;i&gt;realistic&lt;/i&gt; 100+-million row table, and I did not want to demonstrate columnstore indexes on an unrealistic and heavily skewed table or on a table that is too small to show the performance benefit.&lt;/p&gt;</description></item></channel></rss>