Re: Model to store biggest score

2010-03-18 Thread Erik Holstad
Another approach you can take is to add the userid to the score like, => (column=140_uid2, value=[], timestamp=1268841641979) and f you need the score time sorted you can add => (column=140_268841641979_uid2, value=[], timestamp=1268841641979) But I do think that in any case you need to remove the

Re: Model to store biggest score

2010-03-17 Thread Brandon Williams
On Wed, Mar 17, 2010 at 11:48 AM, Richard Grossman wrote: > But in the case of simple column family I've the same problem when I update > the score of 1 user then I need to remove his old score too. For example > here the user uid5 was at 130 now he is at 140 because I add the random > number cass

Re: Model to store biggest score

2010-03-17 Thread Richard Grossman
But in the case of simple column family I've the same problem when I update the score of 1 user then I need to remove his old score too. For example here the user uid5 was at 130 now he is at 140 because I add the random number cassandra will keep all the score evolution. get Keyspace2.topScoreUse

Re: Model to store biggest score

2010-03-17 Thread Brandon Williams
On Wed, Mar 17, 2010 at 11:13 AM, Toby DiPasquale wrote: > > Couldn't you just use a supercolumn whose keys were the score and the > subcolumns were username:true? Basically using the subcolumns as a > list? > Sure, but that complicates getting the top N scores. You'd have to use the OrderedPart

Re: Model to store biggest score

2010-03-17 Thread Toby DiPasquale
On Wed, Mar 17, 2010 at 12:10 PM, Brandon Williams wrote: > On Wed, Mar 17, 2010 at 11:05 AM, Richard Grossman > wrote: >> >> Thanks, But what do you mean by ? >> >>> pack a random integer after the score (so the sort order is maintained) >>> in big endian format and only examine the first 8 byte

Re: Model to store biggest score

2010-03-17 Thread Brandon Williams
On Wed, Mar 17, 2010 at 11:05 AM, Richard Grossman wrote: > Thanks, But what do you mean by ? > > pack a random integer after the score (so the sort order is maintained) in >> big endian format and only examine the first 8 bytes of the column upon >> retrieval. >> >> -Brandon >> > > Do I need to t

Re: Model to store biggest score

2010-03-17 Thread Richard Grossman
Thanks, But what do you mean by ? pack a random integer after the score (so the sort order is maintained) in > big endian format and only examine the first 8 bytes of the column upon > retrieval. > > -Brandon > Do I need to take the score and add like -number like 100-1, 100-2, 100-3 etc... to pr

Re: Model to store biggest score

2010-03-17 Thread Brandon Williams
On Wed, Mar 17, 2010 at 10:38 AM, Richard Grossman wrote: > Hi, > > I trying to find a model where I can keep the list of biggest score for > users. > it's seems simple but I'm stuck here . > For example user1 score = 10 > user2 score = 20 > user3 score = 30