MySQL: How to keep entire myisam table in memory?

只谈情不闲聊 提交于 2019-12-05 10:24:47
ajreal

A better suggestion will be increase query cache size, let mysql do the internal optimization

more details - http://dev.mysql.com/doc/refman/5.5/en/query-cache.html

If you have lots of memory in the machine and you use it for MySQL primarily, the OS should take care of that. With MyISAM the idea is to let the filesystem keep the pages in its cache that are mostly needed. With lots of RAM, chances increase that your table will not hit the disk very much anyway.

This is IMHO even better than trying to make the table of type MEMORY, because then you would have to worry about writes - those should usually be persistent anyway.

So in the end, unless the machine is under much concurrent memory pressure from other apps than the MySQL server - in which case 1GB would not seem to much for a server nowadays - you will probably not have to do anything to achieve your goal :)

You can change the table engine to MEMORY and it will store the full table in memory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!