質問

I want to store an entire MYSQL result in memcached via libmemcached in C. Is this possible or do I have to store each row element in memcached separately?

役に立ちましたか?

解決

If your result set will always be smaller than 1mb then it's possible to save the entire result set. Otherwise (if your result might be greater than 1mb), you'll have to find another solution. If storing each row in memcache works for you, then that's probably a fine solution.

The 1mb limit for value size is a hard limit coded into memcache. The only way around it is to change the limit in the source code and recompile memcache.

See http://groups.google.com/group/memcached/browse_thread/thread/d32434ce77131e48 for some discussion.

(Note: this is all assuming it is possible to serialize your results into a string; if you can't do that, then you can't store individual rows either, because an array is not a limiting factor on serialization ability.)

Here's a post discussing how to Serialize Data Structures in C

他のヒント

Definitely you can do it. You have to find a way to pack all the responses together. It doesn't come to me easily why you would want to do that, anyway.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top