Anyway, I cant get to a approximate method to calculate storage per row for 
Cassandra records.

For example right now my table schema is as follow:

c1 tinyint,

c2 smallint,

c3 bigint,

c4 int,

c5 int,

c6 boolean

primary key ((c1,c2,c3),c4,c5)
According to cql data types document this should allocate like 23 bytes per 
record from my storage but in real experiments turns out that it uses like 70 
bytes per record and compression ratio reported from cfstats is like 0.45... so 
it actually uses like 140 bytes per row if there was no compression.

 Why this much storage overhead? How could i calculate disk usage 
approximately(without inserting actual data)?



Sent using Zoho Mail






---- On Sat, 10 Mar 2018 11:21:44 +0330 onmstester onmstester 
<onmstes...@zoho.com> wrote ----




I've find out that blobs has no gain in storage saving!

I had some 16 digit number which been saved as bigint previously but by saving 
this as blob, the storage usage per record is still the same



Sent using Zoho Mail






---- On Tue, 06 Mar 2018 19:18:31 +0330 Carl Mueller 
<carl.muel...@smartthings.com> wrote ----











If you're willing to do the data type conversion in insert and retrieval, the 
you could use blobs as a sort of "adaptive length int" AFAIK



On Tue, Mar 6, 2018 at 6:02 AM, onmstester onmstester 
<onmstes...@zoho.com> wrote:








I'm using int data type for one of my columns but for 99.99...% its data never 
would be > 65K, Should i change it to smallint (It would save some Gigabytes 
disks in a few months) or Cassandra Compression would take care of it in 
storage? 

What about blob data type ? Isn't  better to use it in such cases? could i 
alter column type from smallInt to int in future if needed?



Sent using Zoho Mail










Reply via email to