{"id":507,"date":"2012-02-22T08:19:00","date_gmt":"2012-02-22T08:19:00","guid":{"rendered":"\/blogs\/joe\/post\/SEQUENCE-Object-versus-Modulus-Hash-Partitioning.aspx"},"modified":"2013-01-02T20:32:29","modified_gmt":"2013-01-03T04:32:29","slug":"sequence-object-versus-modulus-hash-partitioning","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/","title":{"rendered":"SEQUENCE Object versus Modulus Hash Partitioning"},"content":{"rendered":"<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">Last month I wrote a post called <\/font><font style=\"font-size: 11pt\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/hash-partitioning-with-sql-server-2012s-sequence-object-and-cycle-argument\/\" target=\"_blank\">Hash Partitioning with SQL Server 2012&rsquo;s SEQUENCE object and CYCLE argument<\/a><font color=\"#0000ff\"><\/font> and I was asked a good question by Eric Humphrey (<a href=\"http:\/\/twitter.com\/#!\/lotsahelp\" target=\"_blank\" class=\"broken_link\"><font color=\"#0000ff\"><u>t<\/u><\/font>witter<\/a><\/font><font style=\"font-size: 11pt\">) about whether there was any advantage of using a sequence object for hash partitioning over an identity\/modulus\/computed-column technique.<\/font><span><font style=\"font-size: 11pt\">&nbsp; <\/font><\/span><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">At that point I hadn&rsquo;t compared the two techniques, but I wanted to perform a test eventually, so here is what I found&hellip;<span>&nbsp; <\/span>This was a quick-and-dirty test, by the way, as I really should have been working on something else (first), but I needed a little &ldquo;fun&rdquo; time.<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">Before testing, I made a <\/font><font style=\"font-size: 11pt\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/hash-partitioning-with-sql-server-2012s-sequence-object-and-cycle-argument\/\" target=\"_blank\">few minor modifications to the schema<\/a><font color=\"#0000ff\"><\/font><\/font><font style=\"font-size: 11pt\"> used in my original post:<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpFirst\">\n<span><span><font face=\"Calibri\"><font style=\"font-size: 11pt\">1.<\/font><\/font><span style=\"line-height: normal\"><font face=\"Times New Roman\"><font style=\"font-size: 7pt\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/font><\/span><\/span><\/span><font face=\"Calibri\"><font style=\"font-size: 11pt\">I split the range of the partition function as follows:<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpFirst\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">ALTER PARTITION FUNCTION pfFactInternetSales () SPLIT RANGE (0)<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<span><span><font face=\"Calibri\"><font style=\"font-size: 11pt\">2.<\/font><\/font><span style=\"line-height: normal\"><font face=\"Times New Roman\"><font style=\"font-size: 7pt\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/font><\/span><\/span><\/span><font face=\"Calibri\"><font style=\"font-size: 11pt\">I changed the sequence object to be zero-based instead of one-based:<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">CREATE SEQUENCE dbo.Seq_FactInternetSales <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">AS int <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">START WITH 0 <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">INCREMENT BY 1 <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">MINVALUE 0 <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">MAXVALUE 10 <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoListParagraphCxSpMiddle\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">CYCLE <\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt 0.5in\" class=\"MsoListParagraphCxSpLast\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">CACHE 10;<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">That is all that was changed with the sequence object technique I used before. <\/font><\/font><font face=\"Calibri\"><font style=\"font-size: 11pt\">As for a modulus technique, I created two additional columns to another version of the FactInternetSales table:<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt 0.5in\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">ProductID int NOT NULL IDENTITY(1,1),<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><span><font style=\"font-size: 11pt\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><font style=\"font-size: 11pt\">PartitionBucketKey AS ProductID %11<span>&nbsp; <\/span>PERSISTED,<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">After adding the columns I referenced the PartitionBucketKey table as the partition key for the clustered index and imported the data from an INSERT&hellip;SELECT (as I did with the sequence object method).<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">So did the performance differ between the two techniques?<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">Here are the results of eight separate tests (<em>each executed with a cold data cache for the SELECT, truncated destination table and pre-sized data and log files<\/em>):<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n&nbsp;\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" class=\"MsoTableLightGridAccent1\" style=\"border-collapse: collapse; border: medium none\">\n<tbody>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 2.25pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">Test number<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 2.25pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">Rows loaded<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 2.25pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">Buckets<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 2.25pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">Hash Partition<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 2.25pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">Method<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">1<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">26 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Sequence<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">2<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">26 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Sequence<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">3<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">29 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Sequence<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">4<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">26 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Sequence<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">5<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">27 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Modulus<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">6<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">24 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Modulus<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">7<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">25 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; background: #d3dfee; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Modulus<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"145\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: #4f81bd 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<strong><span><font face=\"Cambria\"><font style=\"font-size: 11pt\">8<\/font><\/font><\/span><\/strong>\n\t\t\t<\/p>\n<\/td>\n<td width=\"169\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">1,207,960 rows<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"150\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">11 buckets<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"170\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">26 seconds<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<td width=\"162\" valign=\"top\" style=\"border-bottom: #4f81bd 1pt solid; border-left: medium none; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: #4f81bd 1pt solid; padding-top: 0in\">\n<p style=\"line-height: normal; margin: 0in 0in 0pt\" class=\"MsoNormal\" align=\"center\">\n\t\t\t<font face=\"Calibri\"><font style=\"font-size: 11pt\">Modulus<\/font><\/font>\n\t\t\t<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">So the modulus method seems to perform ever-so-slightly faster than the sequence method.<span>&nbsp; <\/span>Stylistically, the sequence method involved a more direct way to create X number of hash buckets (basically no calculation necessary).<span>&nbsp; <\/span>With that said, the execution plans are nearly identical.<\/font><\/font>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<strong><font face=\"Calibri\"><font style=\"font-size: 11pt\">Sequence Plan (estimated cost &ndash; 17.4357)<\/font><\/font><\/strong>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<span><a href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/21782522\/clip_image002.png\"><img fetchpriority=\"high\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px\" src=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/359141ab\/clip_image002_thumb.png\" border=\"0\" alt=\"clip_image002\" title=\"clip_image002\" width=\"780\" height=\"130\" \/><\/a><\/span>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<strong><font face=\"Calibri\"><font style=\"font-size: 11pt\"><\/font><\/font><\/strong>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<strong><font face=\"Calibri\"><font style=\"font-size: 11pt\">Modulus Plan (estimated cost &ndash; 17.635)<\/font><\/font><\/strong>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<span><a href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/26e695c6\/clip_image004.png\"><img decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px\" src=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/3affb24f\/clip_image004_thumb.png\" border=\"0\" alt=\"clip_image004\" title=\"clip_image004\" width=\"780\" height=\"126\" \/><\/a><\/span>\n<\/p>\n<p style=\"line-height: 13pt; margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<font face=\"Calibri\"><font style=\"font-size: 11pt\">I&rsquo;m sure there are other variations of this test that I could try out, but that&rsquo;s all for now. I&rsquo;m curious about other techniques people may be using (like a CLR function to do the hashing), so please post them here if you have used an interesting variation on this post&rsquo;s theme.<\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last month I wrote a post called Hash Partitioning with SQL Server 2012&rsquo;s SEQUENCE object and CYCLE argument and I was asked a good question by Eric Humphrey (twitter) about whether there was any advantage of using a sequence object for hash partitioning over an identity\/modulus\/computed-column technique.&nbsp; At that point I hadn&rsquo;t compared the two [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-507","post","type-post","status-publish","format-standard","hentry","category-performance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack\" \/>\n<meta property=\"og:description\" content=\"Last month I wrote a post called Hash Partitioning with SQL Server 2012&rsquo;s SEQUENCE object and CYCLE argument and I was asked a good question by Eric Humphrey (twitter) about whether there was any advantage of using a sequence object for hash partitioning over an identity\/modulus\/computed-column technique.&nbsp; At that point I hadn&rsquo;t compared the two [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/\" \/>\n<meta property=\"og:site_name\" content=\"Joe Sack\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-22T08:19:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-01-03T04:32:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/359141ab\/clip_image002_thumb.png\" \/>\n<meta name=\"author\" content=\"Joseph Sack\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph Sack\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/\",\"name\":\"SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\"},\"datePublished\":\"2012-02-22T08:19:00+00:00\",\"dateModified\":\"2013-01-03T04:32:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Performance\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/performance\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SEQUENCE Object versus Modulus Hash Partitioning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\",\"name\":\"Joe Sack\",\"description\":\"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\",\"name\":\"Joseph Sack\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"caption\":\"Joseph Sack\"},\"description\":\"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.\",\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/joe\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/","og_locale":"en_US","og_type":"article","og_title":"SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack","og_description":"Last month I wrote a post called Hash Partitioning with SQL Server 2012&rsquo;s SEQUENCE object and CYCLE argument and I was asked a good question by Eric Humphrey (twitter) about whether there was any advantage of using a sequence object for hash partitioning over an identity\/modulus\/computed-column technique.&nbsp; At that point I hadn&rsquo;t compared the two [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/","og_site_name":"Joe Sack","article_published_time":"2012-02-22T08:19:00+00:00","article_modified_time":"2013-01-03T04:32:29+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/windows-live-writer\/sequence-object-versus-modulus-hash-part\/359141ab\/clip_image002_thumb.png"}],"author":"Joseph Sack","twitter_misc":{"Written by":"Joseph Sack","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/","name":"SEQUENCE Object versus Modulus Hash Partitioning - Joe Sack","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website"},"datePublished":"2012-02-22T08:19:00+00:00","dateModified":"2013-01-03T04:32:29+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/sequence-object-versus-modulus-hash-partitioning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/"},{"@type":"ListItem","position":2,"name":"Performance","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/performance\/"},{"@type":"ListItem","position":3,"name":"SEQUENCE Object versus Modulus Hash Partitioning"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/","name":"Joe Sack","description":"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648","name":"Joseph Sack","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","caption":"Joseph Sack"},"description":"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.","sameAs":["http:\/\/3.209.169.194\/blogs\/joe","https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack"],"url":"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/comments?post=507"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}