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 8995AF37C for ; Sat, 13 Apr 2013 18:07:53 +0000 (UTC) Received: (qmail 34652 invoked by uid 500); 13 Apr 2013 18:07:51 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34626 invoked by uid 500); 13 Apr 2013 18:07:50 -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 34617 invoked by uid 99); 13 Apr 2013 18:07:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Apr 2013 18:07:50 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FILL_THIS_FORM_SHORT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gareth.o.collins@gmail.com designates 209.85.215.171 as permitted sender) Received: from [209.85.215.171] (HELO mail-ea0-f171.google.com) (209.85.215.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Apr 2013 18:07:45 +0000 Received: by mail-ea0-f171.google.com with SMTP id b15so1686848eae.2 for ; Sat, 13 Apr 2013 11:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=f8ieC+ibmTG6RqEakcOFaJk33EtPU4GMITTjwpUl6vQ=; b=SFtbBiRDDJGlntaDWzGSPKBYUp3n/Athy0QSrt64jnt31D9OacAzAM9Oj81qb0IyYg ykOeJe8UKmmCLx0x7DR1kRBrx6YmKpYjYuF1l3zpMe6hHJyERbZhpoyQpmgQjMFW3q18 5h+IQKzF1M7vDsfwx3hXyxJM/I8uayz1ugrIpGFFuiL40B2GBQZl2FiCEpOgnNogUqhv fPyXRiuwwM0XLS7iqx+Mpj9bWnF6k1aK794hvbUArX+O7CnmoOiolIkTR6P/nAgENa0J 96a8K68fvjV6+JrAqGMipXIyXV93knOw/4iv0VtlihSFL1rvUANxdMIuVjLx5Jko7wcM nh5Q== MIME-Version: 1.0 X-Received: by 10.14.182.137 with SMTP id o9mr42003495eem.13.1365876444335; Sat, 13 Apr 2013 11:07:24 -0700 (PDT) Received: by 10.223.203.66 with HTTP; Sat, 13 Apr 2013 11:07:24 -0700 (PDT) In-Reply-To: References: Date: Sat, 13 Apr 2013 14:07:24 -0400 Message-ID: Subject: Re: Anyway To Query Just The Partition Key? From: Gareth Collins To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b343f6045b1cd04da41e4b3 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343f6045b1cd04da41e4b3 Content-Type: text/plain; charset=ISO-8859-1 Thank you for the answer. My apologies. I should have been clearer with my question. Say for example, I have a 1000 partition keys and 10000 rows per partition key I am trying to avoid bringing back 10 million rows to find the 1000 partition keys. I assume I cannot avoid bringing back the 10 million rows (or at least an order of magnitude more than 1000 rows) without having another table? thanks, Gareth On Sat, Apr 13, 2013 at 4:13 AM, Jabbar Azam wrote: > With your example you can do an equality search with surname and city and > then use "in" with country > > Eg. Select * from yourtable where surname="blah" and city="blah blah" and > country in ("country1", "country2") > > Hope that helps > > Jabbar Azam > On 13 Apr 2013 07:06, "Gareth Collins" wrote: > >> Hello, >> >> If I have a cql3 table like this (I don't have a table with this data - >> this is just for example): >> >> create table ( >> surname text, >> city text, >> country text, >> event_id timeuuid, >> data text, >> PRIMARY KEY ((surname, city, country),event_id)); >> >> there is no way of (easily) getting the set (or a subset) of partition >> keys, is there (i.e. surname/city/country)? If I want easy access to do >> queries to get a subset of the partition keys, I have to create another >> table? >> >> I am assuming yes but just making sure I am not missing something obvious >> here. >> >> thanks in advance, >> Gareth >> > --047d7b343f6045b1cd04da41e4b3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you for the answer.

M= y apologies. I should have been clearer with my question.

Say for example, I have a 1000 partition keys and 10000 rows per pa= rtition key I am trying to avoid bringing back 10 million rows to find the = 1000 partition keys. I assume I cannot avoid bringing back the 10 million r= ows (or at least an order of magnitude more than 1000 rows) without having = another table?

thanks,
Gareth
<= div class=3D"gmail_extra">

On Sat, Apr 13= , 2013 at 4:13 AM, Jabbar Azam <ajazam@gmail.com> wrote:

With your example you can do = an equality search with surname and city and then use "in" with c= ountry

Eg.=A0 Select * from yourtable where surname=3D"blah&qu= ot; and city=3D"blah blah" and country in ("country1", = "country2")

Hope that helps

Jabbar Azam

On 13 Apr 2013 07:06, "Gareth Collins"= <gareth= .o.collins@gmail.com> wrote:
Hello,

If I have a cql3 table like this= (I don't have a table with this data - this is just for example):

create table (
=A0 =A0 surname text,
=A0 =A0 city text,
=A0 =A0 country text,
=A0 =A0 e= vent_id timeuuid,
=A0 =A0 data text,
=A0 =A0 PRIMARY KE= Y ((surname, city, country),event_id));

there is no way of (easily) getting the set (or a subset) of partition= keys, is there (i.e. surname/city/country)? If I want easy access to do qu= eries to get a subset of the partition keys, I have to create another table= ?

I am assuming yes but just making sure I am not missing= something obvious here.

thanks in advance,
<= div>Gareth

--047d7b343f6045b1cd04da41e4b3--