imperium2335 Posted June 10, 2011 Share Posted June 10, 2011 In what situations would it be good to use MEMORY? I have just bought a new DB server for us and it has 24gb ram. Is one potential use to load into a memory table all information the user may (or may not) want to use or see upon logging into their user area? Then any changes they make get saved to the hard version of the memory data and the system is checking every second or so for changes to the hard copy and makes updates to the memory table? Quote Link to comment https://forums.phpfreaks.com/topic/239000-memory-storage-engine/ Share on other sites More sharing options...
QuickOldCar Posted June 13, 2011 Share Posted June 13, 2011 Although you may have adequate memory, it's never a good thing to run out of memory. You can try upping the query cache, also the key cache. http://dev.mysql.com/doc/refman/5.6/en/query-cache.html http://dev.mysql.com/doc/refman/5.6/en/myisam-key-cache.html Make indexes in mysql on any WHERE,AND,OR statements in queries. http://dev.mysql.com/doc/refman/5.6/en/create-index.html Page caching will eliminate many calls to the database and display pages faster. can look into this: http://memcached.org/ or see here: http://php.net/manual/en/book.memcache.php Quote Link to comment https://forums.phpfreaks.com/topic/239000-memory-storage-engine/#findComment-1228934 Share on other sites More sharing options...
imperium2335 Posted June 13, 2011 Author Share Posted June 13, 2011 Thanks, I just added a few indexes on foreign keys and it has speeded things up significantly! so thanks. Does this apply to any column that I use in a WHERE like you say, in all cases? Or are there some instances where it's not a good idea? Quote Link to comment https://forums.phpfreaks.com/topic/239000-memory-storage-engine/#findComment-1228974 Share on other sites More sharing options...
QuickOldCar Posted June 13, 2011 Share Posted June 13, 2011 There is more than one type of indexing, and also multiple indexing. Pretty much any WHERE,AND,OR helps greatly, you can even improve on that doing specific groups of keys. http://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html Using explain can help you determine what you need. explain select * from table where a=1 or b=1; http://dev.mysql.com/doc/refman/5.6/en/using-explain.html Quote Link to comment https://forums.phpfreaks.com/topic/239000-memory-storage-engine/#findComment-1228993 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.