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 A976610FD0 for ; Thu, 24 Oct 2013 12:45:09 +0000 (UTC) Received: (qmail 63710 invoked by uid 500); 24 Oct 2013 12:45:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 63053 invoked by uid 500); 24 Oct 2013 12:45:04 -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 63041 invoked by uid 99); 24 Oct 2013 12:45:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 12:45:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.227.17.8] (HELO moutng.kundenserver.de) (212.227.17.8) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 12:44:57 +0000 Received: from [10.90.135.235] ([87.253.171.203]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MgUqY-1VNp251WFy-00NjNy; Thu, 24 Oct 2013 14:44:35 +0200 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Problems using secondary index with IN keyword From: Jan Algermissen In-Reply-To: Date: Thu, 24 Oct 2013 14:44:34 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1510) X-Provags-ID: V02:K0:XdPRgvFD9RSP99wSc3k/OwjMDBBJekDktAqs9/390uX jGsnLF4e74Pl7FHs5PH+DNhHPS0Jjp3ujtIx9ma49oQXPWhpG3 XnCvdycd5VvuPqEC/gmQwBx+PCdyMYHQilLH+XDzYwqA4Mnnpk b3yyAnXZOMBybqO04R+HKjJoTU/uEP5PrfxMu9JU4/90zflMUk /h7aU/FtUAhJzn5rVUNPwzOiq16FgIlHo8YwCgEnTj/jtipx7k 48bsUGJLiCtY2gEuAa/DrsaWa4KkbGf5ISSZBhJsWIedjpIlvI AmGB/vjSEbXrJDbOWn6cAp3g4v72P7zyucMhaWWgmWsg3Mz2MD XpcPjShi9X3hL/Yh6mkxE05VvmRHrkILfTBUXojQQ7ll7I4R1P gNCwBTzpJYSiw== X-Virus-Checked: Checked by ClamAV on apache.org Petter, On 24.10.2013, at 14:38, Petter von Dolwitz (Hem) = wrote: > Hi, >=20 > I have a table that (in simplified version) looks like this: >=20 > CREATE TABLE mytable ( > a varchar, > b varchar, > c varchar > d timstamp, > e varchar, > PRIMARY KEY (a, b, c, d) > ); >=20 > CREATE INDEX mytable_c_idx ON mytable ( c ); >=20 > After populating I execute: >=20 > SELECT * FROM mytable WHERE c=3D'myvalue'; >=20 > which works fine. However, using: >=20 > SELECT * FROM mytable WHERE c IN ('myvalue'); >=20 > gives me: > Bad Request: PRIMARY KEY part c cannot be restricted (preceding part b = is either not restricted or by a non-EQ relation) >=20 > Can anybody explain this? You cannot use a part in a where clause unless you specify the = preceeding parts also. Think of it this way: To resolve yur restriction, C* would have to do a = full scan over all rows to find those rows that have a 'myvalue' C-part. Jan > My aim is to query for more than one value in the c column. Is this = supported? >=20 > Thanks, > Petter >=20 >=20 >=20 >=20 >=20