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 343EC9211 for ; Thu, 21 Jun 2012 06:47:46 +0000 (UTC) Received: (qmail 52632 invoked by uid 500); 21 Jun 2012 06:47:44 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 51982 invoked by uid 500); 21 Jun 2012 06:47:40 -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 51933 invoked by uid 99); 21 Jun 2012 06:47:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 06:47:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sylvain@datastax.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 06:47:32 +0000 Received: by obbwc20 with SMTP id wc20so568968obb.31 for ; Wed, 20 Jun 2012 23:47:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:x-gm-message-state; bh=S2V8btkykifsn0B/W/4V2TeFtNDMrJ0BPpC2FRfFZgM=; b=aly7lhcGBSVM4fhtHmjgrBKnUz8mvMwNisDPWzx0eGn717TjmlPR+5ELgaw8t7QBrt uxRyefh0Hmm244eAEHD+sdeYN0t9uq8huV0OJq3tayN3lPSeQpHqXX8Ciul00X3wGW6k MwpmG4jXWyx3gjAdSs5kRrQ+zRtVsvKW22ZsHgXri+rxvqr8eWQ+Ato+9efyG9dwLESl 7/+KzR2ti5JY/9jrlDpdJI6H7KdQYcnbueHYNjD+h0IkYJDY1/sne5o6gjeN3IiDBg4a q7l2VpBcxrR87RKTHU3aeJgziEoXhUTCqCw6bQ82jNzK0yoY70QGfBDmVtoCW5IvqAxE Bliw== MIME-Version: 1.0 Received: by 10.182.202.71 with SMTP id kg7mr26632088obc.56.1340261230792; Wed, 20 Jun 2012 23:47:10 -0700 (PDT) Received: by 10.182.17.136 with HTTP; Wed, 20 Jun 2012 23:47:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Jun 2012 08:47:10 +0200 Message-ID: Subject: Re: Creating secondary index CQL3 cassandra 1.1.1 From: Sylvain Lebresne To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQktOyb1ojXB8xFlYXrvBs5JkJgg5vNIwrk/ZJWIXyvlIlHDeITQAmCGpXbL8CcjrkOdJwG/ On Thu, Jun 21, 2012 at 5:11 AM, Stephen Powis w= rote: > I have the following schema: > > describe columnfamily visitor_audit; > > CREATE TABLE visitor_audit ( > =A0 visitor_id text, > =A0 audit_id uuid, > =A0 account_id int, > =A0 audit_type int, > =A0 created_at text, > =A0 PRIMARY KEY (visitor_id, audit_id) > ) WITH > =A0 comment=3D'' AND > =A0 caching=3D'KEYS_ONLY' AND > =A0 read_repair_chance=3D0.100000 AND > =A0 gc_grace_seconds=3D864000 AND > =A0 min_compaction_threshold=3D4 AND > =A0 max_compaction_threshold=3D32 AND > =A0 replicate_on_write=3D'true' AND > =A0 compaction_strategy_class=3D'SizeTieredCompactionStrategy' AND > =A0 compression_parameters:sstable_compression=3D'SnappyCompressor'; > > I then created an index by executing the following: > CREATE INDEX ix_accountid ON visitor_audit (account_id); > > When I attempt to execute: select * from visitor_audit where account_id= =3D1; > Nothing is returned even tho I have rows with account_id equal to 1. > > Is there anything I am missing here? You are pretty much hitting https://issues.apache.org/jira/browse/CASSANDRA-4328. In other words, secondary indexes is not yet supported on table with composite PRIMARY KEY, but we don't correctly reject the CREATE INDEX command. -- Sylvain