Storing Timestamps With Microsecond Resolution in RiakTS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Storing Timestamps With Microsecond Resolution in RiakTS

Joe Olson
Is anyone storing timestamps with microsecond resolution in RiakTS?

I'm interested in hearing if anyone is doing this, and how they are doing it. My gut reaction is to have a compound timestamp + integer primary key, with the microsecond part of the timestamp (least significant digits) going in the integer field.

Any guidance would be great!


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: Storing Timestamps With Microsecond Resolution in RiakTS

Alexander Sicular
Hi Joe,

You could do that. Riak currently supports millisecond resolution. Look at the primary key composition. There are two lines, the first is the partition key and the second is the local key. The local key denotes the sort order and is the actual unique key for that grouping (quanta).

You could do something like (syntax?) :

Create table test(

time timestamp not null,
micro int not null,
data varchar not null,

Primary key(

(Quantum(time, 1, m)),
time, micro

)
)

-Alexander 


@siculars

Sent from my iRotaryPhone

On Dec 20, 2016, at 16:05, Joe Olson <[hidden email]> wrote:

Is anyone storing timestamps with microsecond resolution in RiakTS?

I'm interested in hearing if anyone is doing this, and how they are doing it. My gut reaction is to have a compound timestamp + integer primary key, with the microsecond part of the timestamp (least significant digits) going in the integer field.

Any guidance would be great!

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com