Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 2566 invoked from network); 24 Feb 2011 21:02:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 21:02:41 -0000 Received: (qmail 1730 invoked by uid 500); 24 Feb 2011 21:02:36 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 1152 invoked by uid 500); 24 Feb 2011 21:02:36 -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 1141 invoked by uid 99); 24 Feb 2011 21:02:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 21:02:35 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of edlinuxguru@gmail.com designates 209.85.161.44 as permitted sender) Received: from [209.85.161.44] (HELO mail-fx0-f44.google.com) (209.85.161.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 21:02:30 +0000 Received: by fxm15 with SMTP id 15so1002169fxm.31 for ; Thu, 24 Feb 2011 13:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=u16lp9h1BwT1ER8KplhdWey1BTD2ZNZ90LPraICOQdo=; b=QASjPk7bE8T2+fqrNqj+172vaVaQ3zRbz/R/r1HC0x41C8bMpNNYmUgpVTScI2DJpU KegrkJua3ReSTB6Px/xQoRtMcMUmgh5Q74u/3QnriAJGO6ttzyucKkBd1j/0kNwDJnwQ YzG/7zq50kPdzoxc4F54SlVLcfHTiTVDxthrs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rkdBPdlIH8BVC1KEFrAQPxdX9Eas2tBpA0q6GV78aLV3rECMIisbnM3c5ZIE8RoATz G8u1q9dWsHUWnE+2abXM+emQfvH1krbZPfD1mo3AAJ85vkX3PmU/mKV5rJYLtu9Nbw26 EWzyf2FjR8odeKrXULtbURQ3JTh86Cv11LwI4= MIME-Version: 1.0 Received: by 10.223.86.2 with SMTP id q2mr1576433fal.139.1298581225379; Thu, 24 Feb 2011 13:00:25 -0800 (PST) Received: by 10.223.108.203 with HTTP; Thu, 24 Feb 2011 13:00:25 -0800 (PST) In-Reply-To: <1298580931510-6061959.post@n2.nabble.com> References: <1298501380608-6058238.post@n2.nabble.com> <3845211436698111047@unknownmsgid> <1298568880974-6061197.post@n2.nabble.com> <1298571537990-6061356.post@n2.nabble.com> <1298575118030-6061574.post@n2.nabble.com> <1298579694715-6061857.post@n2.nabble.com> <1298580931510-6061959.post@n2.nabble.com> Date: Thu, 24 Feb 2011 16:00:25 -0500 Message-ID: Subject: Re: Understanding Indexes From: Edward Capriolo To: user@cassandra.apache.org Cc: mcasandra , cassandra-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Feb 24, 2011 at 3:55 PM, mcasandra wrote: > > Either I am not explaning properly or I don't understand the data model j= ust > yet. Please check again: > > In below example this is what I understand: > > 1) UserProfile is a CF > 2) 1111 is a row key > 3) username is a column. Each row (eg 1111) has username column > > My understanding is that secondary indexes can be created only on column > value. Which means I can create secondary index only on username, email e= tc. > not on 1111. 1111 is the row key, but you keep saying that I need seconda= ry > index, but I am actually asking about index on the row key. > > Is my understanding incorrect about this? > >> UserProfile =3D { // this is a ColumnFamily >> =A0 =A01111 { =A0 // this is the key to this Row inside the CF >> =A0 =A0 =A0 =A0// now we have an infinite # of columns in this row >> =A0 =A0 =A0 =A0username: "phatduckk", >> =A0 =A0 =A0 =A0email: "[hidden email]", >> =A0 =A0 =A0 =A0phone: "(900) 976-6666" >> =A0 =A0}, // end row >> =A0 =A02222 { =A0 // this is the key to another row in the CF >> =A0 =A0 =A0 =A0// now we have another infinite # of columns in this row >> =A0 =A0 =A0 =A0username: "ieure", >> =A0 =A0 =A0 =A0email: "[hidden email]", >> =A0 =A0 =A0 =A0phone: "(888) 555-1212" >> =A0 =A0 =A0 =A0age: "66", >> =A0 =A0 =A0 =A0gender: "undecided" >> =A0 =A0}, >> =A0} > > -- > View this message in context: http://cassandra-user-incubator-apache-org.= 3065146.n2.nabble.com/Understanding-Indexes-tp6058238p6061959.html > Sent from the cassandra-user@incubator.apache.org mailing list archive at= Nabble.com. > You do not need secondary indexes to search on the RowKey. The Row Key is used by the partitioner to locate your data across the cluster. The Row Key is also used as the primary sort of the SSTables. Thus the row key is naturally indexed.