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 D2B549BBC for ; Thu, 6 Sep 2012 05:32:51 +0000 (UTC) Received: (qmail 67127 invoked by uid 500); 6 Sep 2012 05:32:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 66812 invoked by uid 500); 6 Sep 2012 05:32:46 -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 66785 invoked by uid 99); 6 Sep 2012 05:32:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 05:32:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of venkata.s.rama@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 05:32:39 +0000 Received: by wgbdr13 with SMTP id dr13so920305wgb.25 for ; Wed, 05 Sep 2012 22:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=dRWAdUM8cBqYJv5I9KPVc13u2ugZokpyN2kaLrvnUKk=; b=eWtfVtX805wcy/d+nklLwoteXshb6kEaawf1jLcEas2mMLxvCJ/+Zag6FE2oYFbpse DaweDUNtbbc9a2ssbOTqQ2XaAD/Bkb1EnbRW2xu29FhVDMleaS07hZ0eOEIE81c/uazN FK7PXpcct0HDrqZFeviDbi9VWX/im06tzR1XvmaY5vGMcIib1Wkl+zHp2A1CtHLJHIzF 3wO+gLaRDqA/eCM9r2++IW65zMv3eb8oyjZCr6NU3n35qoaFr8/pXzeW941hhbDrdUL+ clXOr/2pCuWRUkpE7805lbVIpA+chRn99Lh/DPp5t2k/SVOqSIes25EoYrgIOaJkkK6/ ZQPw== MIME-Version: 1.0 Received: by 10.180.8.40 with SMTP id o8mr43120262wia.9.1346909539429; Wed, 05 Sep 2012 22:32:19 -0700 (PDT) Received: by 10.194.91.139 with HTTP; Wed, 5 Sep 2012 22:32:19 -0700 (PDT) Date: Wed, 5 Sep 2012 22:32:19 -0700 Message-ID: Subject: Secondary index read/write explanation From: Venkat Rama To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec555503ca46dab04c901d0c8 --bcaec555503ca46dab04c901d0c8 Content-Type: text/plain; charset=ISO-8859-1 Hi All, I am a new bee to Cassandra and trying to understand how secondary indexes work. I have been going over the discussion on https://issues.apache.org/jira/browse/CASSANDRA-749 about local secondary indexes. And interesting question on http://www.mail-archive.com/user@cassandra.apache.org/msg16966.html. The discussion seems to assume that most common uses cases are ones with range queries. Is this right? I am trying to understand the low cardinality reasoning and how the read gets executed. I have following questions, hoping i can explain my question well :) 1. When a write request is received, it is written to the base CF and secondary index to secondary (hidden) CF. If this right, will the secondary index be written local the node or will it follow RP/OPP to write to nodes. 2. When a coordinator receives a read request with say predicate x=y where column x is the secondary index, how does the coordinator query relevant node(s)? How does it avoid sending it to all nodes if it is locally indexed? If there is any article/blog that can help understand this better, please let me know. Thanks again in advance. VR --bcaec555503ca46dab04c901d0c8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,

I am a new bee to Cassandra and trying to unders= tand how secondary indexes work. =A0I have been going over the discussion o= n=A0https:/= /issues.apache.org/jira/browse/CASSANDRA-749 about local secondary inde= xes. And interesting question on=A0http://www.mail-archive.com/user@ca= ssandra.apache.org/msg16966.html. =A0The discussion seems to assume tha= t most common uses cases are ones with range queries. =A0Is this right?=A0<= /div>

I am trying to understand the low cardinality reasoning= and how the read gets executed. =A0I have following questions, hoping i ca= n explain my question well :)

1. =A0When a write r= equest is received, it is written to the base CF and secondary index to sec= ondary (hidden) CF. If this right, will the secondary index be written loca= l the node or will it follow RP/OPP to write to nodes.
2. =A0When a coordinator receives a read request with say predicate x= =3Dy where column x is the secondary index, how does the coordinator query = relevant node(s)? How does it avoid sending it to all nodes if it is locall= y indexed?

If there is any article/blog that can help understand t= his better, please let me know.

Thanks again in ad= vance.

VR

--bcaec555503ca46dab04c901d0c8--