incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S Ahmed <sahmed1...@gmail.com>
Subject Re: CF that is like a non-clustered index, are key lookups that fast?
Date Tue, 15 Jun 2010 13:53:47 GMT
well it won't be a range, it will be random key lookups.

On Tue, Jun 15, 2010 at 8:44 AM, Gary Dusbabek <gdusbabek@gmail.com> wrote:

> On Tue, Jun 15, 2010 at 04:29, S Ahmed <sahmed1020@gmail.com> wrote:
> > If you store only the key mappings in a column family, for custom
> ordering
> > of rows etc. for things like:
> > friends = {
> >
> >    user_id : { friendid1, friendid2, ....}
> > }
> > or
> > topForumPosts = {
> >
> >     forum_id1 : { post2343, post32343, post32223, ...}
> > }
> >
> > Now on friends page or on the top_forum_posts page you will get back a
> list
> > of post_ids, you will then have to perform lookups on the main 'posts' CF
> to
> > get the actual data.  So if a page is displaying 10, 25, or 50 posts you
> > will have 10, 25 or 50 key based lookups for each page view.
> > Is this the suggested way?  i.e. a look based on a slice to get a list of
> > post_id's, then a seperate call to actually fetch the data for the given
> > entity.
> > Or is cassandra so fast that 50 key based calls is no reason to worry?
>
> You should look at using either multi_get_slice or get_range_slices.
> You'll save on network trips and the amount of work required of the
> cluster.
>
> Gary.
>

Mime
View raw message