cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Veksler <ma...@vekslers.org>
Subject Creating index on part of composite key with Cassandra 1.2.0-beta1
Date Mon, 05 Nov 2012 09:53:41 GMT
Hi,

I'm attempting to build an index on a column acting as part of a composite
key.

This is what I have so far:

CREATE TABLE userinfo2 (
       campaignId int,
       TS timestamp,
       somevalue text,
       PRIMARY KEY (campaignId, TS)
   );


INSERT INTO userinfo2 (campaignId, TS, somevalue) VALUES (23, '2012-10-01',
'Fuck that');
INSERT INTO userinfo2 (campaignId, TS, somevalue) VALUES (52, '2012-10-01',
'Fuck that too');


cqlsh:test1> CREATE INDEX campaignIdIndex ON userinfo2 (campaignId);
*Bad Request: Cannot create index on PRIMARY KEY part campaignid*
*Perhaps you meant to use CQL 2? Try using the -2 option when starting
cqlsh.*


Building an index on other columns works,
cqlsh:test1> CREATE INDEX campaignIdIndex ON userinfo2 (somevalue);



Am I doing something wrong? Are indexes on composite column supported ? If
not, a suggestion for a work around?


Thank you,
Maxim.

Mime
View raw message