Load a MySQL innodb database into memory
        Posted  
        
            by jack
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by jack
        
        
        
        Published on 2010-03-21T05:46:36Z
        Indexed on 
            2010/03/21
            5:51 UTC
        
        
        Read the original article
        Hit count: 408
        
I have a MySQL innodb database at 1.9GB, showed by following command.
SELECT table_schema "Data Base Name",
-> sum( data_length + index_length ) / 1024 /
-> 1024 "Data Base Size in MB",
-> sum( data_free )/ 1024 / 1024 "Free Space in MB"
-> FROM information_schema.TABLES
-> GROUP BY table_schema ; 
+--------------------+----------------------+------------------+
| Data Base Name     | Data Base Size in MB | Free Space in MB |
+--------------------+----------------------+------------------+
| database_name      |        1959.73437500 |   31080.00000000 | 
My questions are:
Does it mean if I set the innodb_buffer_pool_size to 2GB or larger, the whole database can be loaded into memory so much fewer read from disk requests are needed?
What does the free space of 31GB mean?
If the maximum RAM can be allocated to innodb_buffer_pool_size is 1GB, is it possible to specify which tables to loaded into memory while keep others always read from disk?
Thanks in advance.
© Stack Overflow or respective owner