Links vs Key Filters for Performance

Aphyr aphyr at aphyr.com
Thu May 5 18:44:51 EDT 2011


The key filter still has to walk the entire keyspace, which will make 
fetches an O(n) operation as opposed to O(1).

--Kyle

On 05/05/2011 03:35 PM, Andrew Berman wrote:
> I was curious if anyone has any thoughts on what is more performant,
> links or key filters in terms of secondary links.  For example:
>
> I want to be able to look up a user by id and email:
>
> *Link implementation:*
>
> Two buckets: user and user_email, where id is the key of user and email
> is the key of user_email.  User_email contains no data but simply has a
> link pointing back to the proper user.
>
> *Key Filter:*
>
> One bucket: user, where id_email is the key of the bucket.  Lookups
> would use a key filter tokenizing the id and then looking up the id or
> email based on the proper token.
>
> Obviously both work, but I'm curious what the implications are from a
> performance standpoint.
>
> Thanks,
>
> Andrew
>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com




More information about the riak-users mailing list