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 EEFC290EA for ; Mon, 5 Nov 2012 17:56:06 +0000 (UTC) Received: (qmail 44338 invoked by uid 500); 5 Nov 2012 17:56:04 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 44311 invoked by uid 500); 5 Nov 2012 17:56:04 -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 44303 invoked by uid 99); 5 Nov 2012 17:56:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 17:56:04 +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 (nike.apache.org: domain of edlinuxguru@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 17:55:58 +0000 Received: by mail-ie0-f172.google.com with SMTP id 9so9496656iec.31 for ; Mon, 05 Nov 2012 09:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QYJveGlxZrBDvKTzjGuZ9jWu/T38p+EUejkA7UPAI14=; b=uaepOTPaXhTwhJ/Petv58HcwuJhTJ1xGB8knJUnTWCgipEh1kTX7mepdtD7N6NRtYc CxShYjFyoRdToAhvh0B1b5pfBxcbSl6pdBIIaJ9l6MFxCWOnCJqzIUJLkkqfKhlv+1h4 DNR0hL+dtYfIqqAmrxFEGTaeURvch7s1TZ7zNY93dA8GC/0+W2jqVmOhQ8tvtzX4XP1K CYLZIAmUVNAZcrBV2tYbEIEaLoQob0fDwlC7Pf8DkVPTsWblY4hmhlmAM5C5dgGATOtl Nmao+WgiaE0Xm5TPaHxGc8qSggcblqeJ3K5ozmKkGYKqNOqS27ATE1aSwTB6TCfazfTz dcHw== MIME-Version: 1.0 Received: by 10.50.190.161 with SMTP id gr1mr10377163igc.14.1352138137285; Mon, 05 Nov 2012 09:55:37 -0800 (PST) Received: by 10.64.97.106 with HTTP; Mon, 5 Nov 2012 09:55:36 -0800 (PST) In-Reply-To: References: Date: Mon, 5 Nov 2012 12:55:36 -0500 Message-ID: Subject: Re: How does Cassandra optimize this query? From: Edward Capriolo To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I see. It is fairly misleading because it is a query that does not work at scale. This syntax is only helpful if you have less then a few thousand rows in Cassandra. On Mon, Nov 5, 2012 at 12:24 PM, Sylvain Lebresne wrote: > On Mon, Nov 5, 2012 at 4:12 PM, Edward Capriolo > wrote: >> >> Is this query the equivalent of a full table scan? Without a starting >> point get_range_slice is just starting at token 0? > > > It is, but that's what you asked for after all. If you want to start at a > given token you can do: > SELECT * FROM videos WHERE videoname = 'My funny cat' AND token(video) > > 'whatevertokenyouwant' > You can even do: > SELECT * FROM videos WHERE videoname = 'My funny cat' AND token(video) > > token(99051fe9-6a9c-46c2-b949-38ef78858dd0) > if that's simpler for you than computing the token manually. Though that is > mostly for random partitioners. For ordered ones, you can do without the > token() part. > > -- > Sylvain