From user-return-24597-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Wed Mar 7 06:56:35 2012 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54BE19684 for ; Wed, 7 Mar 2012 06:56:35 +0000 (UTC) Received: (qmail 26265 invoked by uid 500); 7 Mar 2012 06:56:32 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 26068 invoked by uid 500); 7 Mar 2012 06:56:30 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 25971 invoked by uid 99); 7 Mar 2012 06:56:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 06:56:29 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [72.35.23.34] (HELO smtp-out2.electric.net) (72.35.23.34) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 06:56:25 +0000 Received: from [10.86.5.46] (helo=fuse246.electric.net) by anders.electric.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1S5An5-0003so-VN for user@cassandra.apache.org; Tue, 06 Mar 2012 22:56:03 -0800 Received: from mailanyone.net by fuse246.electric.net with esmtpsa (TLSv1:AES256-SHA:256) (MailAnyone extSMTP dbrosius@baybroadband.net) id 1S5An4-0002Ri-7T for user@cassandra.apache.org; Tue, 06 Mar 2012 22:56:03 -0800 Message-ID: <4F570676.5050106@mebigfatguy.com> Date: Wed, 07 Mar 2012 01:55:50 -0500 From: Dave Brosius User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: key sorting question References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030504090307030408020906" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------030504090307030408020906 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 > Tel: +972 2 6409736 > Mob: +972 54 8356490 > Fax: +972 2 5612956 > > > --------------030504090307030408020906 Content-Type: multipart/related; boundary="------------070605070402060206020902" --------------070605070402060206020902 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 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 





--------------070605070402060206020902 Content-Type: image/png Content-Transfer-Encoding: base64 Content-ID: iVBORw0KGgoAAAANSUhEUgAAAF0AAAAnCAYAAABtyERkAAAABGdBTUEAALGPC/xhBQAACkNp Q0NQSUNDIFByb2ZpbGUAAHgBnZZ3VFNZE8Dvey+90BJCkRJ6DU1KAJESepFeRSUkAUIJGBKw V0QFVxQVaYoiiyIuuLoUWSuiWFgUFLAvyCKgrIuriIplX/QcZf/Y/b6z88ec35s7c+/cmbnn PAAovoFCUSasAECGSCIO8/FgxsTGMfHdAAZEgAPWAHB52VlB4d4RABU/Lw4zG3WSsUygz/p1 /xe4xfINYTI/m/5/pcjLEkvQnULQkLl8QTYP5TyU03MlWTL7JMr0xDQZwxgZi9EEUVaVcfIX Nv/s84XdZMzPEPFRH1nOWfwMvow7UN6SIxWgjASinJ8jFOSifBtl/XRphhDlNyjTMwTcbAAw FJldIuCloGyFMkUcEcZBeR4ABEryLE6cxRLBMjRPADiZWcvFwuQUCdOYZ8K0dnRkM30FuekC iYQVwuWlccV8JiczI4srWg7AlzvLooCSrLZMtMj21o729iwbC7T8X+VfF796/TvIevvF42Xo 555BjK5vtm+x32yZ1QCwp9Da7PhmSywDoGUTAKr3vtn0DwAgnwdA841Z92HI5iVFIslysrTM zc21EAp4FrKCfpX/6fDV859h1nkWsvO+1o7pKUjiStMlTFlReZnpmVIxMzuLyxMwWX8bYnTr /xw4K61ZeZiHCZIEYoEIPSoKnTKhKBltt4gvlAgzRUyh6J86/B/DZuUgwy9zjQKt5iOgL7EA CjfoAPm9C2BoZIDE70dXoK99CyRGAdnLi9Ye/TL3KKPrn/XfFFyEfsLZwmSmzMwJi2DypOIc GaNvQqawgATkAR2oAS2gB4wBC9gAB+AM3IAX8AfBIALEgsWAB1JABhCDXLAKrAf5oBDsAHtA OagCNaAONIAToAWcBhfAZXAd3AR94D4YBCPgGZgEr8EMBEF4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 FAVd5esLug3rqQ9qyt4DrbtzwC4hJlIVuDB5wK33f3KRdHTxGE8qBQQEdAGOc8aMeQlSUpIF pyPgBw8Kf7kqCjpaqYtZCkz0QqrB5m8OQ0t8PFjq6qhyqcz2ikvQmhkNQoBj9hErB6TS2LEv cx7uOH7OnNkQEfGGI8upjfEdD7pppDjoaMTQ7M+pYQZltuskEXX3LjY9ItvTZmgvJ2BnrQZj fhLYWxqo83HH4rsyhSrzlJmUlAhif6yFhUWA5xCupFgawHFhNdk+Dis8yp2PCh1mOI7Htu1J M5jLS7kjO67YiBzXIVkbH4DtIamNwQMLhjDw6pSh3JFUwwJAF/eZbKdGGN9TU9dDVtY2x2Wc 2jt37uL+fHEsT14BHRdn/P054Fsi3uJtod4tD+ug/YeTYP7+UM91L1QNHUzOwz/YJnsh0qRJ k7hkl9CBBsb3vLzD3MvhzfMa6GgAAi9E7RXlYDy0D2z3rnUWGwmN7JnvE5MF2vnLZPNw1xVj YmKgqqpasPwCa2lCQy/BggXzualeiemuRrv2jRnpoE+MA9st56yg67ie+uy0WBiy9UfQLVrT b4CjDRg60tLoOXvexvz8I11pggEJOm9ob++ayI0c2Hj47MlevLfr4TzcRiYkxIuqwOovTBN4 NbyIWihRqB4/gxxQvAJMGPnY8Q8ENkT6VlDiEpKHYfioqKgQLMnAcjss2Rg0oKtDZoA2IZXU wZCvWp08NSuS0fRgYHJyMilV2SL4RYppYMmg68iDCn0MoKy/iF1Eio6WkaKjsP734CBSnUsj IT5tLO7bExPXQWnpZZqY43Gl0oJSBQTN4yZ2r4IuQEqisTTaJy0ddO+uJOen9JRw96TB15Ls 6Uo8mnrmdNCuJp69cCFgnuZ5pQEBOuZidHFrwGe2Z0X8g/WleD28WGprgZ0gPcU6WIF2tNvr oDsa839pP5cfRwP95f0HN8yA0D1xOrwAAAAASUVORK5CYII= --------------070605070402060206020902-- --------------030504090307030408020906--