15 ms·
I've never used memcache, but my understanding is that memcache stores the results of queries whereas adding ram to the database will perhaps help it store inde
by pj 17y ago
I've never used memcache, but my understanding is that memcache stores the results of queries whereas adding ram to the database will perhaps help it store indexes, tables, and query compiles, but to the best of my knowledge, the results of queries are not stored by DBMSs -- this is why memcache is used.
If my understanding of memcache is correct, throwing more ram at the db won't provide the same performance improvements that memcache will provide.
- rythie 17y agoMySQL has a query cache which stores results of queries, though it's not very useful if you have frequent writes. Linux and other operating systems tend to use any free memory for disk cache which will end up caching the whole database if needed. Innodb has a key cache. Memcached probably helpful on the database server but it's really designed to be ran somewhere else so that database server has as much memory as possible of it's own.
- nomoresecrets 17y agomysql has a query cache, which stores the query and results: http://dev.mysql.com/doc/refman/5.1/en/query-cache.html http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
- chrisbolt 17y agoWith the query cache, if you update a single row in one table, all cached queries that involve that table are invalidated, whether or not that row would have affected the result. This makes it almost useless for many sites.