Skip to content

Instantly share code, notes, and snippets.

@pollin14
Created July 25, 2017 19:57
Show Gist options
  • Save pollin14/7183066a9d9078664e70b75521d61e96 to your computer and use it in GitHub Desktop.
Save pollin14/7183066a9d9078664e70b75521d61e96 to your computer and use it in GitHub Desktop.
Query to return the size of the tables in mysql
/**
Recommended InnoDB Buffer Pool Size (RIBPS) with additional 60% (1.6 rate). The result's units is giga bytes.
Source: https://dba.stackexchange.com/questions/27328/how-large-should-be-mysql-innodb-buffer-pool-size
*/
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment