Load a MySQL innodb database into memory

时光毁灭记忆、已成空白 提交于 2019-12-05 03:49:25
  1. Not exactly. InnoDB buffer pool are used to buffer reads and writes. if most of your access is read, most if it will be cached and fewer disks access will be needed.
  2. could be this bug, it's not documented very well but I think data_free is the available space inside the innodb files (if you write more than this InnoDB will have to enlarge the data file(s)).
  3. no, but InnoDB will cache the data that you access most automatically, so it should have an optimal effect anyway.

consider using memcached as a cache layer to eliminate database access altogether if you need better performance.

  1. It's better to worry about having enough memory to cache the indexes in ram, and leave the data on disk. Database performance suffers greatly if the indexes have to be read from disk each time - far more than the overhead of later retrieving the desired data from disk.
  2. InnoDB data files are created at a fixed size, with the option to autoextend them (create extra files) if they get full. You can see what the per-file size is with show variables like 'innodb_data_file_path'. The free space reported is how much of the current data files is unused. In your case, you've got 2gigs of data stored in (most likely) 32gigs of InnodB data files, leaving 30gig available.
  3. Is there any reason you want to bypass InnoDB's own cacheing logic to pin specific tables in ram? The cache will naturally tend to keep the most frequently accessed data in ram already, and performance will no doubt suffer if you force it to keep less-used data instead of the most popular.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!