update strategy

Ivan Krstic krstic at fas.harvard.edu
Sat Oct 8 07:36:54 PDT 2005


mrot wrote:
> Iam not experienced memcache user so maybe I make some mistake,
> maybe the key shouldn't be SQL queries....

If you're caching rows, key them in cache by table name and primary key,
e.g. 'users:13'. Trying to do it by storing queries is usually a bad
idea for a number of reasons (though it has its purposes), one of which
you've encountered, and another of which is that there exists an
infinite number of SQL queries that will return the same row, so you can
be storing tons of duplicate rows in cache at the same time for no good
reason.

-- 
Ivan Krstic <krstic at fas.harvard.edu> | 0x147C722D


More information about the memcached mailing list