<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">There is one thing computers do really well, and that is iterating thru lists.<br>I would suggest that getting the list from memcache and then processing it is not going to be any slower than getting a list of results from a heavy database query... and... iterating through that. Especially if you use the get_multi instead of thousands of individual gets (but that take a little extra programming to detect an element that wasn't in the cache, but you might get better over-all response times)
<br><br>Of course, its always a useful thing to then store in memcache your PROCESSED data. So after you've iterated through your list and formatted or ordered the data in some format that is useful for you, cache it. Then next time, use the cached version and you don't have to iterate it again. If your data changes frequently, figure out the delta and use it as your expiry time.
</blockquote>
<div> </div>
<div>The problem here is, Memcache arrays don't have indexes where searches for a particular ID or range is fast, as opposed to a DB server. Or is there a way around this too?</div></div>