cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: Composite column names: How much space do they occupy ?
Date Mon, 02 Jan 2012 09:22:32 GMT
What is the definition of the composite type and what is CS.toByteBuffer ? 

CompositeTypes have a small overhead see https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/CompositeType.java

Hope that helps. 
Aaron

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 2/01/2012, at 6:25 PM, Ertio Lew wrote:

> I am storing composite column names which are made up of two integer components. However
I am shocked after seeing the storage overhead of these.
> 
> I just tried out a composite name (with single integer component):
> 
>           Composite composite = new Composite();
>           composite.addComponent(-165376575,is);
> 
> System.out.println(CS.toByteBuffer( composite ).array().length); // the result is 256
> 
> 
> After writing & then reading back this composite column from cassandra:
> 
> System.out.println(CS.toByteBuffer( readColumn.getName() ).array().length); // the result
is 91
> 
> 
> How much is the storage overhead, as I am quite sure that  I'm making a mistake in realizing
the actual values ?


Mime
View raw message