cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <>
Subject Re: TimeUUID vs Epoch
Date Fri, 13 Aug 2010 16:54:34 GMT
On 8/13/10 9:38 AM, Sylvain Lebresne wrote:
> As long as time sorting is involved, you'll the same ordering if you
> use Epoch/Long
> or TimeUUID. The difference is between the ties. If when you insert
> two values at
> the exact same time, you want to have only one stay, then you want LongType.
> If however you don't want to merge such inserts, then you want TimeUUID since
> they assure you that even if generated at the exact same time, the key
> will be different
> (plus if your UUID generator is not too bad, it will give you better
> precision than the
> epoch/long one).
> --
> Sylvain
> On Fri, Aug 13, 2010 at 6:32 PM, Mark<>  wrote:
>> I'm a little confused on when I should be using TimeUUID vs Epoch/Long when
>> I want columns ordered by time. I know it sounds strange and the obvious
>> choice should be TimeUUID but I'm not sure why that would be preferred over
>> just using the Epoch stamp?
>> The pretty much seem to accomplish the same thing however when using Epoch I
>> can easily use a start/end range for querying across times. Can this be
>> accomplished using TimeUUID?
>> Would someone also explain how TimeUUID is actually sorted? Im confused on
>> how its actually compared. Thanks!
So long story short you can give a start/end range when using TimeUUID?

For example I am storing a bunch of records keyed by the current date 
"20100813". Each column is a TimeUUID. If I wanted to get all the 
columns that between some arbitrary time.. say 6am - 9am I can get that?

Using Long I can just use a start of "1281704400000000" and a finish of 
"1281715200000000" but Im unsure of how to represent that as a TimeUUID.

View raw message