Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CBA70DC94 for ; Mon, 5 Nov 2012 09:54:34 +0000 (UTC) Received: (qmail 86849 invoked by uid 500); 5 Nov 2012 09:54:32 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 86825 invoked by uid 500); 5 Nov 2012 09:54:32 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 86802 invoked by uid 99); 5 Nov 2012 09:54:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 09:54:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.215.44] (HELO mail-la0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 09:54:23 +0000 Received: by mail-la0-f44.google.com with SMTP id b11so4240936lam.31 for ; Mon, 05 Nov 2012 01:54:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=O0hs/pnK0928KUgcLob9Z8X0Z0rpNuY50oZqBimyaBg=; b=T7syUSiLRPNe+j6dtpyg+E71e/iNv+9c/7qVFQ6n2ztnZ2YikxsvXP2MLWMzEx3I70 yGLZgXDanFGSSHKUaFBjUkSPlDojtQphR3RyY6HFBpmh4g3uYfMZckR5eUhq9aZM8hDH ao3RSUQPl6UQVzpQvax0xABP4yGdSEPYH+2+yEtv3EqY+D8Ez2wHgutEmv8SvzNZZ8wl ZLkiHAmRi2FD2YWtSKZnrSPddSCnF85jAeFB96+P72HS1yjiYMeLFDHHE+gDTuTXTqLQ MOS9pqBkXbA3/IXxiDRy+bHMaa1s+fSy583wnmT+6nZ11/JNelTb07QZ93/47zPo9QBN Y9Cg== Received: by 10.152.110.42 with SMTP id hx10mr8730793lab.0.1352109241852; Mon, 05 Nov 2012 01:54:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.162.9 with HTTP; Mon, 5 Nov 2012 01:53:41 -0800 (PST) X-Originating-IP: [80.179.214.229] From: Maxim Veksler Date: Mon, 5 Nov 2012 11:53:41 +0200 Message-ID: Subject: Creating index on part of composite key with Cassandra 1.2.0-beta1 To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec54ee8a40ee14404cdbc77d0 X-Gm-Message-State: ALoCoQmpksheKPRhxxR9+jjztP1MlmlXUYPPMdBcm21sBNIX/0nD11QjQcvu/3xTSAk3HmdeqOy5 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec54ee8a40ee14404cdbc77d0 Content-Type: text/plain; charset=ISO-8859-1 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. --bcaec54ee8a40ee14404cdbc77d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

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

T= his is what I have so far:

CREATE TABLE useri= nfo2 (
=A0 =A0 =A0 =A0campaignId int,
=A0 =A0 =A0 =A0TS timestamp,<= /div>
=A0 =A0 =A0 =A0somevalue text,
=A0 =A0 =A0 =A0PRIMARY K= EY (campaignId, TS)
=A0 =A0);


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


=
cqlsh:test1> CREATE INDEX campaignIdIndex ON userinfo2 (campai= gnId);
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,=A0
cqlsh:test1>= CREATE INDEX campaignIdIndex ON userinfo2 (somevalue);


Am I doing something wrong? Are i= ndexes on composite column supported ? If not, a suggestion for a work arou= nd?


Thank you,
Maxim.
--bcaec54ee8a40ee14404cdbc77d0--