cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Mechler <rmech...@sencha.com>
Subject Re: Composite keys question
Date Fri, 25 May 2012 21:47:28 GMT
Thanks for your response, Cyril. Yeah, I realized shortly after asking that
indeed the second term is not being indexed, so it must be doing a table
scan. Indexing for composite columns is in the works (
https://issues.apache.org/jira/browse/CASSANDRA-3680), but not sure how
soon that will be available.

The thing is, it did actually let me search on the second term only, which
is perhaps a little surprising.

-Roland

On Fri, May 25, 2012 at 12:33 PM, Cyril Auburtin
<cyril.auburtin@gmail.com>wrote:

> I'm not much advanced in cassandra, but seeing the pycassa doc
> http://pycassa.github.com/pycassa/assorted/composite_types.html, for
> composites you can't even search for the second term, you need a first
> term, the second will filter, you just do range slices on the composite
> columns
>
> it's totally different from secondary indexes for the rows
>
> also CQL can't do everything as much as the other clients
>
> 2012/5/24 Roland Mechler <rmechler@sencha.com>
>
>> Suppose I have a table in CQL3 with a 2 part composite, and I do a select
>> that specifies just the second part of the key (not the partition key),
>> will this result in a full table scan, or is the second part of the key
>> indexed?
>>
>> Example:
>>
>> cqlsh:"Keyspace1"> CREATE TABLE test_table (part1 text, part2 text, data
>> text, PRIMARY KEY (part1, part2));
>> cqlsh:"Keyspace1"> INSERT INTO test_table (part1, part2, data) VALUES
>> ('1','1','a');
>> cqlsh:"Keyspace1"> SELECT * FROM test_table WHERE part2 = '1';
>>  part1 | part2 | data
>> -------+-------+------
>>      1 |     1 |    a
>>
>> -Roland
>>
>>
>>
>

Mime
View raw message