cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shay Assulin <>
Subject Secondary index - keys only.
Date Sun, 13 Feb 2011 14:48:47 GMT

Is there a way to get only the keys of indexed rows (without getting 
columns) using get_indexed_slices method?

I am using Hector to access Cassandra and I want to count rows with a 
specific index - so i need to get only the keys.

I am doing the following:

n = 0

while (true) {

        indexedSliceQuery.setStartKey(    lastFetchedKey  )   
        indexedSliceQuery.addFilter(  the indexed column EQ value  )

        res = indexedSliceQuery.execute();
        n += res.size();
        update lastFetchedKey
        if (size == 0) break;

It looks like the time it takes to get keys are just like the time it 
takes to get the entire row.

View raw message