Last active
September 8, 2015 14:39
-
-
Save rpavlovic/f05e7951cb34dd8e943f to your computer and use it in GitHub Desktop.
Query to recommended InnoDB buffer pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SELECT @@innodb_buffer_pool_size; | |
# SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) buffer_pool_gigs FROM (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes FROM information_schema.tables WHERE engine='InnoDB') A; | |
SELECT CONCAT(ROUND(KBS/POWER(1024, IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.49999), SUBSTR(' KMG',IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_innodb_buffer_pool_size FROM (SELECT SUM(data_length+index_length) KBS FROM information_schema.tables WHERE engine='InnoDB') A, (SELECT 2 PowerOf1024) B; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment