Altering queries?

Marcus Bointon marcus at synchromedia.co.uk
Fri Sep 21 09:57:44 UTC 2007


On 21 Sep 2007, at 10:25, K J wrote:

> What I meant was, suppose I have a Memached list of 1000 IDs. Now I  
> want to search that list to see if ID 234 is in that list or not.   
> My program logic would have to iterate through that entire list  
> correct?  Whereas MySQL would use its index to find it quickly.

Yes, but it's probably built in to your language and thus an awful  
lot faster to do an isset() / in_array() or array_key_exists() (PHP)  
on an array that you have in hand than to have a trip to the DB. In  
fact the language may index arrays internally anyway. MySQL with an  
index will be faster than MySQL without an index, but it will still  
be much slower than local array searching.

Marcus
-- 
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
UK resellers of info at hand CRM solutions
marcus at synchromedia.co.uk | http://www.synchromedia.co.uk/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070921/a878ab5e/attachment.html


More information about the memcached mailing list