Azu Posted March 27, 2007 Share Posted March 27, 2007 Is it possible to make it so that certain tables are stored entirely in RAM so that the hardrive does not need to be accessed no matter how much it is used, and it just saves it to hardrive every once in a while in case the power goes out or something? And if it is please tell me how I use MyIsam btw.. Quote Link to comment https://forums.phpfreaks.com/topic/44462-solved-ram/ Share on other sites More sharing options...
Tyche Posted March 27, 2007 Share Posted March 27, 2007 You can use Memory (or Heap) tables which are created in RAM and these are extremely fast- however should only be used as temporary tables as all data is lost if there is a system shutdown - The Table structure is preserved (since this is stored as .frm files) but the contents will be deleted CREATE TABLE memory_table ENGINE=MEMORY; or if using a MYSQL version < 4.1 CREATE TABLE memory_table TYPE=HEAP; If the data is fairly static you could create a cron job to copy the MEMORY tables to a more permanent table (such as a MyISAM one) every now and then - The same job could be used to reload the MEMORY tables from this permanent backup table if they are found to be empty (i.e. after a server restart) using a INSERT INTO memory_table SELECT * FROM backup_table; command Quote Link to comment https://forums.phpfreaks.com/topic/44462-solved-ram/#findComment-216072 Share on other sites More sharing options...
Azu Posted March 28, 2007 Author Share Posted March 28, 2007 Thanks a bunch! That's exactly what I was looking for =D Quote Link to comment https://forums.phpfreaks.com/topic/44462-solved-ram/#findComment-216763 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.