----- Original Message -----
> From: Josh Berkus <josh@agliodbs.com>
> To: postgres performance list <pgsql-performance@postgresql.org>
> Cc:
> Sent: Thursday, May 5, 2011 2:02 AM
> Subject: Re: [PERFORM] amazon ec2
> So memcached basically replaces the filesystem?
>
> That sounds cool, but I'm wondering if it's actually a performance
> speedup. Seems like it would only be a benefit for single-row lookups;
> any large reads would be a mess.
I've never tested with pgsql, but with mysql it makes a *huge* difference when you're pulling data repeatedly.
Multi-rowlookups can be cached too:
$rows = $cache->get(md5($query . '--' . serialize($args)));
if ( !$rows) {
// query and cache for a few hours...
}
This is true even with mysql's caching features turned on. You spare the DB from doing identical queries that get
repeatedover and over. Memcache lets you pull those straight from the memory, allowing for the DB server to handle new
queriesexclusively.