order of results from get_multi

13 views
Skip to first unread message

ionous

unread,
Dec 5, 2008, 11:21:39 PM12/5/08
to memcached
i poked around on the faq and mail lists, but haven't seen anything
definitive;
does anyone know whether there is a guaranteed order to the items
returned in get_multi?

if i asked for the values at keys: 5,4,3,2,1 - and key 1 expired
itself -
would memcached return the keys: 5,4,3,2 in that order?

i playing with a stack-like ( queue-like? :) idea that uses auto-
expiring values to detect the current bottom of the stack -- it's a
minor thing but it would simplify the logic in my code that process
the results of get_multi if the order of the returns happened to be
the order of the requests.

( i'm using the python client which returns the keys as dictionaries,
so i'd have to change that code to return a list, but really i'm just
curious about the server's mechanics )

thanks for any insights!

-simon.

Dustin

unread,
Dec 6, 2008, 1:10:12 AM12/6/08
to memcached


On Dec 5, 8:21 pm, ionous <shalmane...@gmail.com> wrote:
> i poked around on the faq and mail lists, but haven't seen anything
> definitive;
> does anyone know whether there is a guaranteed order to the items
> returned in get_multi?

You may observe some pattern to the results, but non is guaranteed.

Aaron Stone

unread,
Dec 13, 2008, 3:47:20 PM12/13/08
to memc...@googlegroups.com
On Fri, Dec 5, 2008 at 10:10 PM, Dustin <dsal...@gmail.com> wrote:
>
>
>
> On Dec 5, 8:21 pm, ionous <shalmane...@gmail.com> wrote:
>> i poked around on the faq and mail lists, but haven't seen anything
>> definitive;
>> does anyone know whether there is a guaranteed order to the items
>> returned in get_multi?
>
> You may observe some pattern to the results, but non is guaranteed.

Ooh, let's document that!

steve.yen

unread,
Dec 14, 2008, 12:24:40 PM12/14/08
to memcached
Thanks, added it to the code.google.com wiki/FAQ.

http://code.google.com/p/memcached/wiki/FAQ

On Dec 13, 12:47 pm, "Aaron Stone" <sodab...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages