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 E39D89D84 for ; Fri, 30 Mar 2012 13:39:46 +0000 (UTC) Received: (qmail 16438 invoked by uid 500); 30 Mar 2012 13:39:44 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 16415 invoked by uid 500); 30 Mar 2012 13:39:44 -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 16407 invoked by uid 99); 30 Mar 2012 13:39:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 13:39:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sylvain@datastax.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 13:39:40 +0000 Received: by obbta17 with SMTP id ta17so1175969obb.31 for ; Fri, 30 Mar 2012 06:39:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :x-gm-message-state:content-type:content-transfer-encoding; bh=O+GMskXumgo5H8mkSThBUyEE8WhDntsu0tGqCNLbSGg=; b=WMZ9nl2oco5KXxLLHzD+BOwfFMlJn4ASgJ2anxMInTu4AGVnf78gAGAWT+FlERg7MY 0lGbvuJESQuCew81QfTbU8iq70u3dYD/UAhYzqW+jtFlkCkDoKHuWDaogX6Lhcf3y02M /9vhUX7nf5/aKy4Naer/yiNDJKXM/7VZ8/z/pjTtGwsHdDgzkwgJrcN8Oeyz2dfxcO97 2xbNdWDwN7517FTkmSLUULm57+1g9J99hChnCnW1IcQKju7Z/lMTXepIqzSVJbxAd9bO rzVAt7RaNb306ghxO6pjD420dN32A7THKWnGNiJGrW3BZzCIhkWC8ZsXeM0r5zGv+8oL Qmcg== MIME-Version: 1.0 Received: by 10.182.52.104 with SMTP id s8mr2835407obo.59.1333114759089; Fri, 30 Mar 2012 06:39:19 -0700 (PDT) Received: by 10.60.65.161 with HTTP; Fri, 30 Mar 2012 06:39:18 -0700 (PDT) In-Reply-To: References: Date: Fri, 30 Mar 2012 15:39:18 +0200 Message-ID: Subject: Re: composite query performance depends on component ordering From: Sylvain Lebresne To: user@cassandra.apache.org X-Gm-Message-State: ALoCoQnLrx/j8u+ayqBtFeFKrCi7LXmKuP8DGAAOMU+Bg7i5hJHK7SdN6kpq1nUMFS2rvaThBRTP Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org When you do a query, there's a lot of comparison happening between what's queries and the column names. But the composite comparator is lazy in that when it compares two names, if the first component are not equal, it doesn't have to compare the second one. So What's likely happening is that in the first case you do 1 millions comparison of 8 bytes, in the latter you do 1 millions comparison of 100 bytes. -- Sylvain On Fri, Mar 30, 2012 at 2:30 PM, Alexandru Sicoe wrote: > Sender: adsicoe@gmail.com > Subject: composite query performance depends on component ordering > Message-Id: > Recipient: Adam.Nicholls@hl.co.uk > > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com > ______________________________________________________________________ > > ---------- Forwarded message ---------- > From:=A0Alexandru Sicoe > To:=A0 > Cc: > Date:=A0Fri, 30 Mar 2012 14:29:47 +0200 > Subject:=A0composite query performance depends on component ordering > Hi guys, > =A0I am consistently seeing a 20% improvement in query retrieval times if= I use the composite comparator "Timestamp:ID" instead of "ID:Timestamp" wh= ere Timestamp=3DLong and ID=3D~100 character strings. I am retrieving all c= olumns=A0 (~1 million) from a single row. Why is this happening? > > Cheers, > Alex >