Warning: Constant WP_TEMP_DIR already defined in /var/www/html/blogs/joe/wp-config.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":954,"date":"2013-03-21T09:57:11","date_gmt":"2013-03-21T16:57:11","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/joe\/?p=954"},"modified":"2013-03-21T10:05:43","modified_gmt":"2013-03-21T17:05:43","slug":"which-lob-pages-are-associated-with-a-segment","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/","title":{"rendered":"Which LOB pages are associated with a specific columnstore segment?"},"content":{"rendered":"

Chalk this post up as an \u201cexploratory\u201d mission based on the following question\u2026<\/p>\n

How do I track which LOB pages are associated with a specific columnstore index segment?<\/p>\n

Jonathan Kehayias<\/a> and I discussed this the other day and hashed out a few options for tracking this.<\/p>\n

To illustrate this topic and keep it at a granular level – I used a simple table named FactIDDemo with a bigint FactID column that had a unique clustered index on it.\u00a0 Again \u2013 exploratory and not<\/em> intended to be a realistic implementation pattern.<\/p>\n

I loaded the table with 1,048,576 rows. And the segment statistics were as follows:<\/p>\n

\r\nSELECT\u00a0 [partition_id],\r\n[segment_id],\r\n[row_count],\r\n[min_data_id],\r\n[max_data_id]\r\nFROM\u00a0\u00a0\u00a0 sys.[column_store_segments]\r\nWHERE\u00a0\u00a0 [partition_id] = 72057594043236352 ;\r\n<\/pre>\n

\"image\"<\/a><\/p>\n

How many LOB pages were allocated for this single segment?<\/p>\n

\r\nSELECT\u00a0 [partition_id],\r\n[object_id],\r\n[index_id],\r\n[partition_number],\r\n[in_row_used_page_count],\r\n[lob_used_page_count],\r\n[used_page_count],\r\n[row_count]\r\nFROM sys.[dm_db_partition_stats]\r\nWHERE [partition_id] = 72057594043236352;\r\n<\/pre>\n

\"image\"<\/a><\/p>\n

We see 351 used LOB pages and executing DBCC IND confirms this as well, outputting the page ids accordingly:<\/p>\n

\r\nDBCC IND('BigFactTable', 'FactIDDemo', 2);\r\n<\/pre>\n

That command returned 351 rows \u2013 one of which was the IAM page and the remainder text pages.<\/p>\n

I also created the following XE session to validate page access (testing on a cold cache using my session ID as well):<\/p>\n

\r\nCREATE EVENT SESSION [Columnstore Page Access] ON SERVER\r\nADD EVENT sqlserver.physical_page_read(\r\nACTION(sqlserver.session_id)\r\nWHERE ([sqlserver].[session_id]=(57)))\r\nWITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,\r\nMAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,\r\nTRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)\r\nGO\r\n<\/pre>\n

And I used the following test query to initiate the physical page read events:<\/p>\n

\r\nSELECT\u00a0 COUNT([FactID]) AS [FactIDCount]\r\nFROM [dbo].[FactIDDemo]\r\nWHERE [FactID] BETWEEN 1 AND 1048576;\r\nGO\r\n<\/pre>\n

This query resulted in 349 events related directly to the columnstore index access.\u00a0 That is different from the 351 page count from sys.[dm_db_partition_stats] and DBCC IND output.\u00a0 The XE event didn\u2019t capture the IAM page reference (in my case, page 1870780) \u2013 and it also didn\u2019t retrieve page 1870777 which was a pagetype 3 (LOB page) and when I looked at it via DBCC PAGE, didn\u2019t show BLOB_FRAGMENT sections.<\/p>\n

Segments are the unit of transfer for columnstore index access.\u00a0 While this is the logical unit of transfer, a segment is stored as one or more LOB pages \u2013 and to track that physical access, it seems that the sqlserver.physical_page_read is a viable way of doing so.<\/p>\n","protected":false},"excerpt":{"rendered":"

Chalk this post up as an \u201cexploratory\u201d mission based on the following question\u2026 How do I track which LOB pages are associated with a specific columnstore index segment? Jonathan Kehayias and I discussed this the other day and hashed out a few options for tracking this. To illustrate this topic and keep it at a […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-954","post","type-post","status-publish","format-standard","hentry","category-columnstore-indexes"],"yoast_head":"\nWhich LOB pages are associated with a segment? - 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\/which-lob-pages-are-associated-with-a-segment\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Which LOB pages are associated with a segment? - Joe Sack\" \/>\n<meta property=\"og:description\" content=\"Chalk this post up as an \u201cexploratory\u201d mission based on the following question\u2026 How do I track which LOB pages are associated with a specific columnstore index segment? Jonathan Kehayias and I discussed this the other day and hashed out a few options for tracking this. To illustrate this topic and keep it at a […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/\" \/>\n<meta property=\"og:site_name\" content=\"Joe Sack\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-21T16:57:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-03-21T17:05:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/2013\/03\/image_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=\"2 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\/which-lob-pages-are-associated-with-a-segment\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/\",\"name\":\"Which LOB pages are associated with a segment? - Joe Sack\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\"},\"datePublished\":\"2013-03-21T16:57:11+00:00\",\"dateModified\":\"2013-03-21T17:05:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Columnstore indexes\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/columnstore-indexes\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Which LOB pages are associated with a specific columnstore segment?\"}]},{\"@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":"Which LOB pages are associated with a segment? - 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\/which-lob-pages-are-associated-with-a-segment\/","og_locale":"en_US","og_type":"article","og_title":"Which LOB pages are associated with a segment? - Joe Sack","og_description":"Chalk this post up as an \u201cexploratory\u201d mission based on the following question\u2026 How do I track which LOB pages are associated with a specific columnstore index segment? Jonathan Kehayias and I discussed this the other day and hashed out a few options for tracking this. To illustrate this topic and keep it at a […]","og_url":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/","og_site_name":"Joe Sack","article_published_time":"2013-03-21T16:57:11+00:00","article_modified_time":"2013-03-21T17:05:43+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-content\/uploads\/2013\/03\/image_thumb.png"}],"author":"Joseph Sack","twitter_misc":{"Written by":"Joseph Sack","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/","name":"Which LOB pages are associated with a segment? - Joe Sack","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website"},"datePublished":"2013-03-21T16:57:11+00:00","dateModified":"2013-03-21T17:05:43+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/which-lob-pages-are-associated-with-a-segment\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/"},{"@type":"ListItem","position":2,"name":"Columnstore indexes","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/columnstore-indexes\/"},{"@type":"ListItem","position":3,"name":"Which LOB pages are associated with a specific columnstore segment?"}]},{"@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\/954","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=954"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/954\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/media?parent=954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/categories?post=954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/tags?post=954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}