{"id":246,"date":"2017-11-01T09:10:21","date_gmt":"2017-11-01T09:10:21","guid":{"rendered":"http:\/\/www.mrmarkyoung.com\/oracle\/?p=246"},"modified":"2018-06-04T16:42:27","modified_gmt":"2018-06-04T06:42:27","slug":"calculate-table-size-in-mysql","status":"publish","type":"post","link":"http:\/\/www.mrmarkyoung.com\/oracle\/2017\/11\/01\/calculate-table-size-in-mysql\/","title":{"rendered":"Calculate Table Size in MySQL"},"content":{"rendered":"<p>How to calculate all tables in a schema<\/p>\n<pre class=\"lang:default decode:true \" >SELECT TABLE_NAME AS \"Table Name\", \r\ntable_rows AS \"Quant of Rows\", ROUND( (\r\ndata_length + index_length\r\n) \/1024, 2 ) AS \"Total Size Kb\"\r\nFROM information_schema.TABLES\r\nWHERE information_schema.TABLES.table_schema = 'YOUR SCHEMA NAME\/DATABASE NAME HERE'\r\nLIMIT 0 , 30;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to calculate all tables in a schema SELECT TABLE_NAME AS &#8220;Table Name&#8221;, table_rows AS &#8220;Quant of Rows&#8221;, ROUND( ( data_length + index_length ) \/1024, 2 ) AS &#8220;Total Size Kb&#8221; FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema = &#8216;YOUR SCHEMA NAME\/DATABASE NAME HERE&#8217; LIMIT 0 , 30;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/comments?post=246"}],"version-history":[{"count":1,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":260,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/246\/revisions\/260"}],"wp:attachment":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/media?parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/categories?post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/tags?post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}