I have 2 different flavors of CF with the same data
create column family story_top_ten_covisited
with column_type = 'Standard'
and comparator = 'CompositeType(org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LongType),org.apache.cassandra.db.marshal.UTF8Type)'
and default_validation_class = 'UTF8Type'
create column family story_top_ten_covisited_increasing
with column_type = 'Standard'
and comparator = 'CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type)'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'UTF8Type'
Both are similar in all respects , apart from the org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LongType) in the first CF.
I run Hector code
MultigetSliceQuery<String,Composite,String> multigetSliceQuery =
HFactory.createMultigetSliceQuery(keyspace, StringSerializer.get(), cs,StringSerializer.get());
multigetSliceQuery.setColumnFamily(CF_TT);
multigetSliceQuery.setKeys(getKeysFromStories(recentStories));
multigetSliceQuery.setRange(null, null , true , 10);
QueryResult<Rows<String, Composite,String>> q = multigetSliceQuery.execute();
with reverse true or false.
I see that when reverse = true is outperforming reverse=false ( in both cases ) by a factor of 30 ....
I am using version 1.0.5. I would have assumed and ( http://thelastpickle.com/2011/10/03/Reverse-Comparators/ ) supports the natural intuition , that if I want my composite keys to be in descending , based on the first key, I would be better off using "reversed = true" in my CF creation script and than use "false" in my Hector range query.
The tests show that assumption is incorrect.
Is there a gap in my understanding here ?
