Hi,
Disk-wise it's the same because a bigint is serialized as a 8 bytes ByteBuffer 
and if you want to store a Long as bytes into a blob type it will take 8 bytes 
too, right?The difference is the validation. The blob ByteBuffer will be stored 
as is whereas the bigint will be validated. So technically the Long is slower, 
but I guess that's not noticeable.
Yes you can use a blob as a partition key. I would use the bigint both for 
validation and clarity. 
Best,
Romain 

    Le Mercredi 7 septembre 2016 22h54, Alexandr Porunov 
<alexandr.poru...@gmail.com> a écrit :
 

 Hello,

I need to store a "Long" Java variable.The question is: whether the storage 
cost is the same both for store hex representation of "Long" variable to the 
blob and for store "Long" variable to the bigint?Are there any performance pros 
or cons?Is it OK to use blob as primary key?
Sincerely,Alexandr

   

Reply via email to