incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Creating index on part of composite key with Cassandra 1.2.0-beta1
Date Mon, 05 Nov 2012 11:00:46 GMT
On Mon, Nov 5, 2012 at 11:35 AM, Maxim Veksler <maxim@vekslers.org> wrote:

> OK,
>
> A different question then, Is there any meaning of discussing composite
> key not in the context of a table "primary key" ?
> For making additional hierarchy inside a single row by using columns.
>

Not really in the sense that a CQL row don't necessarily correspond to an
internal row as with the thrift API. So using a composite PRIMARY KEY
already make additional hierarchy inside a single internal row.
Please see  http://www.datastax.com/dev/blog/thrift-to-cql3 for more
details.

--
Sylvain



>
> On Mon, Nov 5, 2012 at 12:14 PM, Sylvain Lebresne <sylvain@datastax.com>wrote:
>
>> On Mon, Nov 5, 2012 at 10:53 AM, Maxim Veksler <maxim@vekslers.org>wrote:
>>
>>> Are indexes on composite column supported ?
>>>
>>
>> Index on any part of the PRIMARY KEY is not supported (whether the
>> PRIMARY KEY is composite or not btw), not yet at least.
>>
>>
>>> If not, a suggestion for a work around?
>>>
>>
>>  In your case, you're asking for an index on the first component of the
>> PRIMARY KEY, which is non-sensical in the sense that this component is
>> already always "indexed".
>>
>> If you want all the rows whose campaignId = 3, just do SELECT FROM
>> userinfo2 WHERE campaignId = 3.
>>
>> --
>> Sylvain
>>
>>
>

Mime
View raw message