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 C25F69E1A for ; Wed, 12 Oct 2011 00:55:14 +0000 (UTC) Received: (qmail 75249 invoked by uid 500); 12 Oct 2011 00:55:12 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 75216 invoked by uid 500); 12 Oct 2011 00:55:12 -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 75208 invoked by uid 99); 12 Oct 2011 00:55:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 00:55:12 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ey0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 00:55:07 +0000 Received: by eyg24 with SMTP id 24so195421eyg.31 for ; Tue, 11 Oct 2011 17:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=SPFdfE+Gl3IGqDZl3/81lyyH3e/XTYUnjg+8YWJsU64=; b=YDm4os+1UnrR6h3RIuKF+bea1v1Ox6u4ZbU312qMzwK1Q04cSwEY7Jya0+13yteoGU JoBZwZztPMGWnIjGAEjhCjHe531DxR5GhvRp17ZM7ktTIemHJut7knW3bgh0LVpH0mAI liSu3bh1BLO/+pBJUUo+go1vo9E8MBrK7gLIg= Received: by 10.213.15.7 with SMTP id i7mr1144572eba.14.1318380885199; Tue, 11 Oct 2011 17:54:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.17.71 with HTTP; Tue, 11 Oct 2011 17:54:25 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Tue, 11 Oct 2011 19:54:25 -0500 Message-ID: Subject: Re: Operator on secondary indexes in 0.8.x (GTE/LTE) To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable simple, elegant, and less performant than just doing a range scan without the index. :) On Tue, Oct 11, 2011 at 4:06 PM, Sasha Dolgy wrote: > ah, hadn't even thought of that. =A0simple. =A0elegant. > cheers. > > On Tue, Oct 11, 2011 at 11:01 PM, Jake Luciani wrote: >> >> This hasn't changed in AFAIK, =A0In Brisk we had the same problem in CFS= so >> we created a=A0sentinel=A0value that all rows shared then it works. >> CASSANDRA-2915 should fix it. >> On Tue, Oct 11, 2011 at 4:48 PM, Sasha Dolgy wrote: >>> >>> I was trying to get a range of rows based on a secondary_index that was >>> defined. =A0Any rows where age was greater than or equal to ... it didn= 't >>> work. =A0Is this a continued limitation? =A0Did a quick look in JIRA, c= ouldn't >>> find anything. >>> The output from "help get;" on the cli contains the following, which le= d >>> me to believe it was a limitation on Cassandra 0.7.x and not on 0.8.x .= .. >>> get where [ >>> =A0 =A0 and and ...] [limit ]; >>> get where () [ >>> =A0 =A0 and and ...] [limit ]; >>> - operator: Operator to test the column value with. Supported operators >>> are >>> =A0 =3D, >, >=3D, <, <=3D . >>> =A0 In Cassandra 0.7 at least one =3D operator must be present. >>> [default@sdo] =A0get user where age >=3D 18; >>> No indexed columns present in index clause with operator EQ >>> [default@sdo]=A0 get user where gender =3D 1 and age >=3D 18 >>> (returns results) >>> Tested this behavior on 0.8.2, 0.8.6 and now 0.8.7 ... >>> create column family user >>> =A0 with column_type =3D 'Standard' >>> =A0 and comparator =3D 'UTF8Type' >>> =A0 and default_validation_class =3D 'BytesType' >>> =A0 and key_validation_class =3D 'BytesType' >>> =A0 and memtable_operations =3D 0.24843749999999998 >>> =A0 and memtable_throughput =3D 53 >>> =A0 and memtable_flush_after =3D 1440 >>> =A0 and rows_cached =3D 0.0 >>> =A0 and row_cache_save_period =3D 0 >>> =A0 and keys_cached =3D 200000.0 >>> =A0 and key_cache_save_period =3D 14400 >>> =A0 and read_repair_chance =3D 1.0 >>> =A0 and gc_grace =3D 864000 >>> =A0 and min_compaction_threshold =3D 4 >>> =A0 and max_compaction_threshold =3D 32 >>> =A0 and replicate_on_write =3D true >>> =A0 and row_cache_provider =3D 'ConcurrentLinkedHashCacheProvider' >>> =A0 and column_metadata =3D [ >>> =A0 =A0 {column_name : 'gender', >>> =A0 =A0 validation_class : LongType, >>> =A0 =A0 index_name : 'user_gender_idx', >>> =A0 =A0 index_type : 0}, >>> =A0 =A0 {column_name : 'year', >>> =A0 =A0 validation_class : LongType, >>> =A0 =A0 index_name : 'user_year_idx', >>> =A0 =A0 index_type : 0}]; >>> >>> >>> -- >>> Sasha Dolgy >>> sasha.dolgy@gmail.com >> >> >> >> -- >> http://twitter.com/tjake > > > > -- > Sasha Dolgy > sasha.dolgy@gmail.com > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com