{"id":1146,"date":"2007-10-19T19:26:04","date_gmt":"2007-10-19T19:26:04","guid":{"rendered":"\/blogs\/paul\/post\/Tool-for-estimating-the-size-of-a-database.aspx"},"modified":"2017-04-13T09:52:07","modified_gmt":"2017-04-13T16:52:07","slug":"tool-for-estimating-the-size-of-a-database","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/","title":{"rendered":"Tool for estimating the size of a database"},"content":{"rendered":"<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">[Edit 8\/25\/2013: The tool referenced in this post is no longer available.]<\/span><\/span><\/p>\n<p>During SQL Server 2005 development I did a comprehensive rewrite of the Books Online entries concerned with estimating index, table, and database size (see <a href=\"https:\/\/msdn.microsoft.com\/Areas\/Epx\/Content\/500.htm?aspxerrorpath=\/en-us\/library\/ms187445.aspx\"><span style=\"color: #5588aa;\">http:\/\/msdn2.microsoft.com\/en-us\/library\/ms187445.aspx<\/span><\/a>). I\u00a0was recently having a\u00a0discussion with <a href=\"https:\/\/accounts.google.com\/ServiceLogin?service=blogger&amp;hl=en&amp;passive=86400&amp;continue=http:\/\/www.blogger.com\/blogin.g?blogspotURL%3Dhttp:\/\/dbgoby.blogspot.com\/%26zx%3D10ar1khpyi3tv&amp;ltmpl=private\">\u00d8ystein Sundsb\u00f8<\/a> about a bug in one of the formulas I wrote and it turns out he&#8217;s written a neat tool that codifies all the formulas.<\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p>In case you&#8217;re interested, the part of the formula I had incorrect was for figuring out how many pages would be needed for the upper levels of an index b-tree. My formula was:<\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p align=\"center\"><span style=\"color: #000000;\"><strong><em>Num_Index_Pages<\/em> <\/strong>= \u2211<sub>Level<\/sub> (<b><i>Index_Rows_Per_Page<\/i><\/b>)<sup>Level \u2013 1<\/sup><br \/>\nwhere 1 &lt;= Level &lt;= <b><i>Levels<\/i><\/b><\/span><\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p>and \u00d8ystein\u00a0came up with a better formula:<\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p align=\"center\"><span style=\"color: #000000;\"><strong><em>Num_Index_Pages<\/em> <\/strong>= \u2211<sub>Level<\/sub> (<strong><em>Total_Num_Rows<\/em><\/strong>\/(<em><strong>Index_Rows_Per_Page<\/strong><\/em>)<sup>Level <\/sup>)<br \/>\nwhere 1 &lt;= Level &lt;= <b><i>Levels<\/i><\/b><\/span><\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #000000;\">where in both formulas:<\/span><\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p align=\"center\"><strong><em>Levels<\/em> <\/strong>= 1 + log <sub>Index_Rows_Per_Page<\/sub> (<b><i>Total_Num_Rows<\/i><\/b> \/ <b><i>Index_Rows_Per_Page<\/i><\/b>)<\/p>\n<p><span style=\"font-family: Verdana;\"><span style=\"font-size: small;\">\u00a0<\/span><\/span><\/p>\n<p dir=\"ltr\" style=\"margin-right: 0px;\" align=\"left\"><span style=\"color: #000000;\"><span style=\"color: #003300;\">Check out \u00d8ystein&#8217;s cool tool\u00a0at <\/span><a href=\"https:\/\/accounts.google.com\/ServiceLogin?service=blogger&amp;hl=en&amp;passive=86400&amp;continue=http:\/\/www.blogger.com\/blogin.g?blogspotURL%3Dhttp:\/\/dbgoby.blogspot.com\/2007\/10\/db-goby-v10.html%26zx%3D1592fdqfeymtw&amp;ltmpl=private\">http:\/\/dbgoby.blogspot.com\/2007\/10\/db-goby-v10.html<\/a>!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Edit 8\/25\/2013: The tool referenced in this post is no longer available.] During SQL Server 2005 development I did a comprehensive rewrite of the Books Online entries concerned with estimating index, table, and database size (see http:\/\/msdn2.microsoft.com\/en-us\/library\/ms187445.aspx). I\u00a0was recently having a\u00a0discussion with \u00d8ystein Sundsb\u00f8 about a bug in one of the formulas I wrote and [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,95],"tags":[],"class_list":["post-1146","post","type-post","status-publish","format-standard","hentry","category-on-disk-structures","category-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tool for estimating the size of a database - Paul S. Randal<\/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\/paul\/tool-for-estimating-the-size-of-a-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tool for estimating the size of a database - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"[Edit 8\/25\/2013: The tool referenced in this post is no longer available.] During SQL Server 2005 development I did a comprehensive rewrite of the Books Online entries concerned with estimating index, table, and database size (see http:\/\/msdn2.microsoft.com\/en-us\/library\/ms187445.aspx). I\u00a0was recently having a\u00a0discussion with \u00d8ystein Sundsb\u00f8 about a bug in one of the formulas I wrote and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2007-10-19T19:26:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:52:07+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/\",\"name\":\"Tool for estimating the size of a database - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2007-10-19T19:26:04+00:00\",\"dateModified\":\"2017-04-13T16:52:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tool for estimating the size of a database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tool for estimating the size of a database - Paul S. Randal","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\/paul\/tool-for-estimating-the-size-of-a-database\/","og_locale":"en_US","og_type":"article","og_title":"Tool for estimating the size of a database - Paul S. Randal","og_description":"[Edit 8\/25\/2013: The tool referenced in this post is no longer available.] During SQL Server 2005 development I did a comprehensive rewrite of the Books Online entries concerned with estimating index, table, and database size (see http:\/\/msdn2.microsoft.com\/en-us\/library\/ms187445.aspx). I\u00a0was recently having a\u00a0discussion with \u00d8ystein Sundsb\u00f8 about a bug in one of the formulas I wrote and [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/","og_site_name":"Paul S. Randal","article_published_time":"2007-10-19T19:26:04+00:00","article_modified_time":"2017-04-13T16:52:07+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/","name":"Tool for estimating the size of a database - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2007-10-19T19:26:04+00:00","dateModified":"2017-04-13T16:52:07+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tool-for-estimating-the-size-of-a-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Tool for estimating the size of a database"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/1146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=1146"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/1146\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=1146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=1146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=1146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}