{"id":2483,"date":"2014-07-16T16:00:45","date_gmt":"2014-07-16T20:00:45","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=2483"},"modified":"2014-11-13T13:35:18","modified_gmt":"2014-11-13T18:35:18","slug":"partition-boundaries","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/","title":{"rendered":"Partition Boundaries &#8211; Left or Right: That is the Question"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nPartition boundaries can be set to be a left range or a right range. While this is a seemingly simple decision, it starts getting complex if you are really trying to understand what those two options mean. That is not necessarily helped by the fact that different terminologies seem to contradict each other. For example, a left range builds intervals that are right side inclusive.\n<\/p>\n<h3>Left and Right Ranges and Partition Boundaries<\/h3>\n<p>\nSQL Server partitioning uses two constructs, the partition scheme and the partition function. An un-partitioned table is placed in a filegroup during creation: <span class=\"tt\">CREATE TABLE \u2026 ON PRIMARY<\/span>. If you are creating a table that is partitioned, instead of placing it into a filegroup, you place it on a partition scheme. The partition scheme is basically a collection of storage units called partitions, each being assigned to a filegroup. (However, multiple partitions can live in the same filegroup.)\n<\/p>\n<p>\nThe partition function decides which row in the table ends up in which partition based on a single column. Let us assume that that column is an <span class=\"tt\">INT<\/span> column, say the <span class=\"tt\">id<\/span> column. (I am using <span class=\"tt\">INT<\/span> as an example. However, the concept is the same for other data types.) The partition function does not go and assigns blocks of values to partitions directly; instead, it splits the entirety of possible values into sections. An <span class=\"tt\">INT<\/span> can store values from <span class=\"tt\">-2147483648<\/span> to <span class=\"tt\">2147483647<\/span>.\n<\/p>\n<p>\nTo split that into two sections, we have to define just one boundary. If we chose the value <span class=\"tt\">3<\/span> for that first boundary, we would create two partitions: One that accepts values from <span class=\"tt\">-2147483648<\/span> to <span class=\"tt\">3<\/span> and one for values from <span class=\"tt\">3<\/span> to <span class=\"tt\">2147483647<\/span>. If we now add a second boundary at <span class=\"tt\">6<\/span>, we end up with three partitions: The first one still accepting values from <span class=\"tt\">-2147483648<\/span> to <span class=\"tt\">3<\/span>, the second for values from <span class=\"tt\">3<\/span> to <span class=\"tt\">6<\/span>, and the last one finally for values from <span class=\"tt\">6<\/span> to <span class=\"tt\">2147483647<\/span>.\n<\/p>\n<p>\nYou might have noticed an ambiguity in the preceding paragraph. The English language is particularly fuzzy on boundary conditions. The text above does not specify, which partitions the boundary values themselves belong to. Do the go to the left or the right?\n<\/p>\n<p>\nLet me use a diagram to clarify:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg\" alt=\"Two possible interpretations of the partition Boundaries.\" title=\"Two possible interpretations of the partition Boundaries.\" width=\"856\" height=\"394\" class=\"aligncenter size-full wp-image-2486\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg 856w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries-300x138.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries-150x69.jpg 150w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/a>\n<\/p>\n<p>\nFor each boundary, you have to decide if the boundary value is part of the preceding partition or part of the following. As we commonly write from left to right, you can ask that same question this way: Is the boundary value part of the partition to its left or part of the partition to its right?\n<\/p>\n<p>\nSQL Server does not allow us to make that decision individually for each boundary. Instead, you decide for all boundaries in a partition function at once.\n<\/p>\n<h3>The CREATE PARTITION FUNCTION Statement<\/h3>\n<p>\nTo create a partition function you have to use the <span class=\"tt\">CREATE PARTITION FUNCTION<\/span> statement. In this statement you decide if the boundary values are in their left or right partition by specifying either <span class=\"tt\">RANGE LEFT<\/span> or <span class=\"tt\">RANGE RIGHT<\/span>, followed by a comma separated list of the actual boundary values:\n<\/p>\n<div>\n[sql]\nCREATE PARTITION FUNCTION ThreeStepLeft(INT)<br \/>\nAS RANGE LEFT FOR VALUES(3,6);<\/p>\n<p>CREATE PARTITION FUNCTION ThreeStepRight(INT)<br \/>\nAS RANGE RIGHT FOR VALUES(3,6);<br \/>\n[\/sql]\n<\/p><\/div>\n<p>\nNow that we have those two partition functions (using the same two boundary values) in place, we can actually compare their behavior.\n<\/p>\n<h3>RANGE LEFT vs RANGE RIGHT<\/h3>\n<p>\nFirst, let us finish the setup by creating two tables that are partitioned based on these functions:\n<\/p>\n<div>\n[sql]\nCREATE PARTITION SCHEME ThreeStepLeftScheme AS PARTITION ThreeStepLeft ALL TO([PRIMARY]);<\/p>\n<p>CREATE TABLE dbo.LeftTable<br \/>\n(<br \/>\n  Id INT PRIMARY KEY CLUSTERED,<br \/>\n  OtherValue INT DEFAULT CHECKSUM(NEWID())<br \/>\n) ON ThreeStepLeftScheme(id);<\/p>\n<p>INSERT INTO dbo.LeftTable(id) VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9);<\/p>\n<p>--<\/p>\n<p>CREATE PARTITION SCHEME ThreeStepRightScheme AS PARTITION ThreeStepRight ALL TO([PRIMARY]);<\/p>\n<p>CREATE TABLE dbo.RightTable<br \/>\n(<br \/>\n  Id INT PRIMARY KEY CLUSTERED,<br \/>\n  OtherValue INT DEFAULT CHECKSUM(NEWID())<br \/>\n) ON ThreeStepRightScheme(id);<\/p>\n<p>INSERT INTO dbo.RightTable(id) VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9);<br \/>\n[\/sql]\n<\/p><\/div>\n<p>\nThe above SQL snippet defines a partition scheme for each of the two partition functions. The schemes are of the most simple type, assigning all partitions to the primary filegroup. The snippet also creates a table for each partition scheme and inserts rows with <span class=\"tt\">id<\/span> values ranging from <span class=\"tt\">1<\/span> to <span class=\"tt\">9<\/span>.\n<\/p>\n<p>\nTwo years ago, I published a <a href=\"http:\/\/sqlity.net\/en\/1031\/partitions-boundaries-filgroups\/\">query that lists all partitions<\/a> in a database together with their boundaries. Below you can find an improved version of that query:\n<\/p>\n<div>\n[sql]\nSELECT  f.NAME AS file_group_name,<br \/>\n        SCHEMA_NAME(t.schema_id) AS table_schema,<br \/>\n        t.name AS table_name,<br \/>\n        p.partition_number,<br \/>\n        ISNULL(CAST(left_prv.value AS VARCHAR(MAX))+ CASE WHEN pf.boundary_value_on_right = 0 THEN ' &lt; '<br \/>\n               ELSE ' &lt;= '<br \/>\n          END , '-INF &lt; ')<br \/>\n        + 'X' + ISNULL(CASE WHEN pf.boundary_value_on_right = 0 THEN ' &lt;= '<br \/>\n                           ELSE ' &lt; '<br \/>\n                      END + CAST(right_prv.value AS NVARCHAR(MAX)), ' &lt; INF') AS range_desc,<br \/>\n        pf.boundary_value_on_right,<br \/>\n        ps.name AS partition_schem_name,<br \/>\n        pf.name AS partition_function_name,<br \/>\n        left_prv.value AS left_boundary,<br \/>\n        right_prv.value AS right_boundary<br \/>\nFROM    sys.partitions p<br \/>\nJOIN    sys.tables t<br \/>\n        ON p.object_id = t.object_id<br \/>\nJOIN    sys.indexes i<br \/>\n        ON p.object_id = i.object_id<br \/>\n        AND p.index_id = i.index_id<br \/>\nJOIN    sys.allocation_units au<br \/>\n        ON p.hobt_id = au.container_id<br \/>\nJOIN    sys.filegroups f<br \/>\n        ON au.data_space_id = f.data_space_id<br \/>\nLEFT JOIN    sys.partition_schemes ps<br \/>\n        ON ps.data_space_id = i.data_space_id<br \/>\nLEFT JOIN    sys.partition_functions pf<br \/>\n        ON ps.function_id = pf.function_id<br \/>\nLEFT JOIN sys.partition_range_values left_prv<br \/>\n        ON left_prv.function_id = ps.function_id<br \/>\n           AND left_prv.boundary_id + 1 = p.partition_number<br \/>\nLEFT JOIN sys.partition_range_values right_prv<br \/>\n        ON right_prv.function_id = ps.function_id<br \/>\n           AND right_prv.boundary_id = p.partition_number<br \/>\n[\/sql]\n<\/div>\n<p>\nFiltered to include only those two tables we created before, the query returns this result:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/a_verbose_sys.partitions_query.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/a_verbose_sys.partitions_query.jpg\" alt=\"A verbose sys.partitions Query\" title=\"A verbose sys.partitions Query\" width=\"768\" height=\"468\" class=\"aligncenter size-full wp-image-2485\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/a_verbose_sys.partitions_query.jpg 768w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/a_verbose_sys.partitions_query-300x182.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/a_verbose_sys.partitions_query-150x91.jpg 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>\n<\/p>\n<p>\nThere are a few more columns in there that did not fit on the screen, but the more important ones are included. I would like you to look at <span class=\"tt\">partition_number<\/span>, <span class=\"tt\">range_desc<\/span> and <span class=\"tt\">boundary_value_on_right<\/span> for a second. The latter is set to <span class=\"tt\">1<\/span> is the partition function was created with the <span class=\"tt\">RANGE RIGHT<\/span> clause, which means that each boundary belongs to the partition on its right. The <span class=\"tt\">range_desc<\/span> column explains what values will be stored in each partition.\n<\/p>\n<p>\nI would ask you to trust me on that query, but I know you rather see proof that the range description is actually, what happens under the covers.\n<\/p>\n<h3>Determining the Partition in Which a Particular Row is Stored<\/h3>\n<p>\nThere is no documented way to directly determine the partition a particular table row is stored in. There is a way to <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms188071.aspx\" target=\"BOL\">pass any value to a partition function<\/a> and receive a (partition) number in return. However, that does not really tell us that the row actually was stored in that partition.\n<\/p>\n<p>\nLuckily, if we combine two pieces of undocumented functionality, we can still see which partition a particular row is stored in. Those two functions are the <a href=\"http:\/\/sqlity.net\/en\/2451\/physloc\/\"><span class=\"tt\">%%physloc%%<\/span> virtual column<\/a> that returns the <span class=\"tt\">file_id<\/span> and <span class=\"tt\">page_id<\/span> of the page the row is stored in and the <a href=\"http:\/\/sqlity.net\/en\/2471\/sys-dm_db_database_page_allocations\/\"><span class=\"tt\">sys.dm_db_database_page_allocations<\/span> DMF<\/a> that lists all the database pages that belong to a partition.\n<\/p>\n<p>\nTogether these two provide enough information to determine the actual partition of a row in a partitioned table. However, before we can use them we need to execute two more steps. First we need to translate the output of the <span class=\"tt\">%%physloc%%<\/span> column into separate values for the file and page ids. For that we can use the <span class=\"tt\">sys.fn_PhysLocCracker<\/span> function. Second, we do not know the partition of our row upfront, so we need to get the full list of pages to compare with. That can be achieved by passing in <span class=\"tt\">NULL<\/span> to all parameters but the first of the <span class=\"tt\">sys.dm_db_database_page_allocations<\/span> DMF. With that, it returns all pages in the specified database.\n<\/p>\n<p>\nPutting this all together, we can write a query like the following:\n<\/p>\n<div>\n[sql]\nSELECT T.*,<br \/>\n       DDDPA.partition_id AS partition_number,<br \/>\n       ISNULL<br \/>\n       (<br \/>\n         CAST(LEFT_PRV.value AS VARCHAR(MAX)) +<br \/>\n           CASE WHEN PF.boundary_value_on_right = 0 THEN ' &lt; ' ELSE ' &lt;= ' END ,<br \/>\n         '-INF &lt; '<br \/>\n       ) +<br \/>\n       'X' +<br \/>\n       ISNULL<br \/>\n       (<br \/>\n         CASE WHEN PF.boundary_value_on_right = 0 THEN ' &lt;= ' ELSE ' &lt; ' END +<br \/>\n           CAST(RIGHT_PRV.value AS NVARCHAR(MAX)),<br \/>\n         ' &lt; INF'<br \/>\n       ) AS range_desc,<br \/>\n       PF.boundary_value_on_right<br \/>\n  FROM dbo.LeftTable AS T<br \/>\n CROSS APPLY sys.fn_PhysLocCracker(T.%%physloc%%) AS FPLC<br \/>\n  JOIN sys.dm_db_database_page_allocations(DB_ID(),NULL,NULL,NULL,NULL) AS DDDPA<br \/>\n    ON DDDPA.allocated_page_page_id = FPLC.page_id<br \/>\n   AND DDDPA.allocated_page_file_id = FPLC.file_id<br \/>\n  JOIN sys.indexes AS I<br \/>\n    ON DDDPA.object_id = I.object_id<br \/>\n   AND DDDPA.index_id = I.index_id<br \/>\n  LEFT JOIN sys.partition_schemes PS<br \/>\n    ON PS.data_space_id = I.data_space_id<br \/>\n  LEFT JOIN sys.partition_functions pf<br \/>\n    ON ps.function_id = pf.function_id<br \/>\n  LEFT JOIN sys.partition_range_values left_prv<br \/>\n    ON left_prv.function_id = ps.function_id<br \/>\n   AND left_prv.boundary_id + 1 = DDDPA.partition_id<br \/>\n  LEFT JOIN sys.partition_range_values right_prv<br \/>\n    ON right_prv.function_id = ps.function_id<br \/>\n   AND right_prv.boundary_id = DDDPA.partition_id;<br \/>\n[\/sql]\n<\/div>\n<p>\nThis query, in addition to determining the actual partition of a row, also uses part of the previous query to create the <span class=\"tt\">range_desc<\/span> column of the identified partition for easier comparison. The important column however is <span class=\"tt\">DDDPA.partition_id<\/span>, aliased as <span class=\"tt\">partition_number<\/span>. That is the column that returns the partition number for each row.\n<\/p>\n<p>\nIf you want to use this query on a different table, all you have to do is replace the single occurrence of <span class=\"tt\">dbo.LeftTable<\/span> with the new table name. The two screenshots below show the output of this query for both the <span class=\"tt\">dbo.LeftTable<\/span> and the <span class=\"tt\">dbo.RightTable<\/span>.\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_LeftTable.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_LeftTable.jpg\" alt=\"Row to Partition match for dbo.LeftTable\" title=\"Row to Partition match for dbo.LeftTable\" width=\"768\" height=\"468\" class=\"aligncenter size-full wp-image-2487\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_LeftTable.jpg 768w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_LeftTable-300x182.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_LeftTable-150x91.jpg 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_RightTable.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_RightTable.jpg\" alt=\"Row to Partition match for dbo.RightTable\" title=\"Row to Partition match for dbo.RightTable\" width=\"768\" height=\"468\" class=\"aligncenter size-full wp-image-2484\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_RightTable.jpg 768w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_RightTable-300x182.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/row_to_partition_match_for_RightTable-150x91.jpg 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>\n<\/p>\n<p>\nAs you can now clearly see, when looking at the <span class=\"tt\">id<\/span> and the <span class=\"tt\">partition_number<\/span> columns, the output in the <span class=\"tt\">range_desc<\/span> column is accurate.\n<\/p>\n<h3>The Take-Away<\/h3>\n<p>\nNow that you, I hope, understand partition boundaries a little better, let use recap what we found out.\n<\/p>\n<ol>\n<li>A partition function cuts the entire range of possible values in \"partitions\", based on boundary values. The number of partitions is always one higher than the number of boundary values.<\/li>\n<li>Each boundary separates two partitions from each other: A left partition with smaller values and a right partition with larger values.<\/li>\n<li>Each boundary value for a single partition function belongs either to the partition to its left or the partition to its right. Which one is depending on the partition function having been created with <span class=\"tt\">RANGE LEFT<\/span> or <span class=\"tt\">RANGE RIGHT<\/span> respectively.<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover a unique query to determine the actual partition a row is stored in. With this query you can quickly confirm your RANGE-assumption or find out where you got it wrong.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":2486,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[29,5,27,14,105],"tags":[117,210,211,15],"class_list":["post-2483","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fundamentals","category-general","category-series","category-sql-server-internals","category-storage-wednesday","tag-partition","tag-partition-boundary","tag-partition-function","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Partition Boundaries - Left or Right: That is the Question - sqlity.net<\/title>\n<meta name=\"description\" content=\"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Partition Boundaries - Left or Right: That is the Question - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-16T20:00:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:35:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"856\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"Partition Boundaries &#8211; Left or Right: That is the Question\",\"datePublished\":\"2014-07-16T20:00:45+00:00\",\"dateModified\":\"2014-11-13T18:35:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/\"},\"wordCount\":1901,\"commentCount\":3,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/interpretation_of_partition_boundaries.jpg\",\"keywords\":[\"Partition\",\"partition boundary\",\"partition function\",\"SQL Server\"],\"articleSection\":[\"Fundamentals\",\"General\",\"Series\",\"SQL Server Internals\",\"Storage Wednesday\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/\",\"name\":\"Partition Boundaries - Left or Right: That is the Question - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/interpretation_of_partition_boundaries.jpg\",\"datePublished\":\"2014-07-16T20:00:45+00:00\",\"dateModified\":\"2014-11-13T18:35:18+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/interpretation_of_partition_boundaries.jpg\",\"contentUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/interpretation_of_partition_boundaries.jpg\",\"width\":856,\"height\":394,\"caption\":\"Two possible interpretations of the partition Boundaries.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2483\\\/partition-boundaries\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Partition Boundaries &#8211; Left or Right: That is the Question\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Partition Boundaries - Left or Right: That is the Question - sqlity.net","description":"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.","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:\/\/sqlity.net\/en\/2483\/partition-boundaries\/","og_locale":"en_US","og_type":"article","og_title":"Partition Boundaries - Left or Right: That is the Question - sqlity.net","og_description":"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.","og_url":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2014-07-16T20:00:45+00:00","article_modified_time":"2014-11-13T18:35:18+00:00","og_image":[{"width":856,"height":394,"url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","type":"image\/jpeg"}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"Partition Boundaries &#8211; Left or Right: That is the Question","datePublished":"2014-07-16T20:00:45+00:00","dateModified":"2014-11-13T18:35:18+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/"},"wordCount":1901,"commentCount":3,"image":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","keywords":["Partition","partition boundary","partition function","SQL Server"],"articleSection":["Fundamentals","General","Series","SQL Server Internals","Storage Wednesday"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/","url":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/","name":"Partition Boundaries - Left or Right: That is the Question - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","datePublished":"2014-07-16T20:00:45+00:00","dateModified":"2014-11-13T18:35:18+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"Do you know the difference between a RANGE LEFT and a RANGE RIGHT partition function? Read on and discover how the partition boundaries actually work.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#primaryimage","url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","contentUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","width":856,"height":394,"caption":"Two possible interpretations of the partition Boundaries."},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/2483\/partition-boundaries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"Partition Boundaries &#8211; Left or Right: That is the Question"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/07\/interpretation_of_partition_boundaries.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-E3","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=2483"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2483\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media\/2486"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=2483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=2483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=2483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}