You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tamar Fraenkel <ta...@tok-media.com> on 2012/03/07 07:51:36 UTC

key sorting question

Hi!
I am currently experimenting with Cassandra 1.0.7, but while reading
http://www.datastax.com/dev/blog/schema-in-cassandra-1-1
something caught my eye:
"Cassandra orders version 1
UUIDs<http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_.28MAC_address.29>
by
their time component"
Is this true?
If I have for example USER_CF where key is randomly generated
java.util.UUID (UUID.randomUUID()), will the rows be sorted by the
generation time?
I use random partitioner if that makes any difference.
Thanks,



*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956

Re: key sorting question

Posted by Tamar Fraenkel <ta...@tok-media.com>.
Thanks.

*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Wed, Mar 7, 2012 at 8:55 AM, Dave Brosius <db...@mebigfatguy.com>wrote:

>  With random partitioner, the rows are sorted by the hashes of the keys,
> so for all intents and purposes, not sorted.
>
> This comment below really is talking about how columns are sorted, and yes
> when time uuids are used, they are sorted by the time component, as a time
> uuids start with the time component and then adds various randomness bits.
>
>
> On 03/07/2012 01:51 AM, Tamar Fraenkel wrote:
>
>  Hi!
> I am currently experimenting with Cassandra 1.0.7, but while reading
> http://www.datastax.com/dev/blog/schema-in-cassandra-1-1
> something caught my eye:
> "Cassandra orders version 1 UUIDs<http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_.28MAC_address.29> by
> their time component"
> Is this true?
> If I have for example USER_CF where key is randomly generated
> java.util.UUID (UUID.randomUUID()), will the rows be sorted by the
> generation time?
> I use random partitioner if that makes any difference.
> Thanks,
>
>
>
>  *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> [image: Inline image 1]
>
> tamar@tok-media.com
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>
>

Re: key sorting question

Posted by Dave Brosius <db...@mebigfatguy.com>.
With random partitioner, the rows are sorted by the hashes of the keys, 
so for all intents and purposes, not sorted.

This comment below really is talking about how columns are sorted, and 
yes when time uuids are used, they are sorted by the time component, as 
a time uuids start with the time component and then adds various 
randomness bits.

On 03/07/2012 01:51 AM, Tamar Fraenkel wrote:
> Hi!
> I am currently experimenting with Cassandra 1.0.7, but while reading 
> http://www.datastax.com/dev/blog/schema-in-cassandra-1-1  
> something caught my eye:
> "Cassandra orders version 1 UUIDs 
> <http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_.28MAC_address.29> by 
> their time component"
> Is this true?
> If I have for example USER_CF where key is randomly generated 
> java.util.UUID (UUID.randomUUID()), will the rows be sorted by the 
> generation time?
> I use random partitioner if that makes any difference.
> Thanks,
>
>
>
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> Inline image 1
>
> tamar@tok-media.com <ma...@tok-media.com>
> Tel: +972 2 6409736
> Mob: +972 54 8356490
> Fax: +972 2 5612956
>
>
>