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 0B80EF99C for ; Tue, 1 Oct 2013 16:13:05 +0000 (UTC) Received: (qmail 30133 invoked by uid 500); 1 Oct 2013 16:13:01 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 30051 invoked by uid 500); 1 Oct 2013 16:13:01 -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 30035 invoked by uid 99); 1 Oct 2013 16:13:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2013 16:13:00 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of y2klyf@gmail.com designates 209.85.217.178 as permitted sender) Received: from [209.85.217.178] (HELO mail-lb0-f178.google.com) (209.85.217.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2013 16:12:56 +0000 Received: by mail-lb0-f178.google.com with SMTP id z5so6083334lbh.37 for ; Tue, 01 Oct 2013 09:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=MXvcvhcK8Bm8g+zt+pP8fqlgsxjD3ZXq1mcQtRGZefI=; b=FJBGw/+Flbe5HXrTZetC3GGJtjHpXBwjW4tuq5gobjF7bd6Tyz05ZUWOwM3vo7bUEN CZr/zxJjcIFngL3ENfWvenlC8ig3zTkppl2PoD/f8Q7nN31nt8O1HajEwy4vaDKpGQZz 8DWvEi1LpoXIAEl03CwLaRDKrF54dnsCSKPa1wLKgINZcLUzDXe2o4pSMqIl7027/qF0 48EExx3rAXK8PtPWFYRPRebRp3/cyxxddoyGLwLPKABGnwcDrqOLml8ZGrYQ3o8o7YvZ 4CooExDliedGuYO7VtWtYe+hzIBnT11NwiH5ikqUeZMHRK9FYrNLgns1ktvGJWt4A6KI DnRA== MIME-Version: 1.0 X-Received: by 10.152.37.103 with SMTP id x7mr12479472laj.28.1380643955190; Tue, 01 Oct 2013 09:12:35 -0700 (PDT) Sender: y2klyf@gmail.com Received: by 10.114.28.134 with HTTP; Tue, 1 Oct 2013 09:12:35 -0700 (PDT) In-Reply-To: References: <091300EC-D46D-4AD5-AD62-4969F71BB62D@nordsc.com> Date: Tue, 1 Oct 2013 09:12:35 -0700 X-Google-Sender-Auth: bkRGShe1113nASaK0EPfmX4Kzqo Message-ID: Subject: Re: paging through a table with timeuuid primary key From: Jimmy Lin To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0160b5e482b11f04e7b038db X-Virus-Checked: Checked by ClamAV on apache.org --089e0160b5e482b11f04e7b038db Content-Type: text/plain; charset=ISO-8859-1 unfortunately, i have to stick with 1.2 for now for a while. So I am looking for the old fashion way to do the pagination correctly. I think i follow most of the articles on how to paging through a table, but maybe have some silly gap that don't give me the correct behavior or it is timeuuid not working for token function? On Tue, Oct 1, 2013 at 8:57 AM, David Ward wrote: > 2.0 has a lot of really exciting stuff, unfortunately 2.0 has a lot of > really exciting stuff that may increase the risk of updating to 2.0 just > yet. > > > On Tue, Oct 1, 2013 at 9:30 AM, Jan Algermissen < > jan.algermissen@nordsc.com> wrote: > >> Jimmy, >> >> On 01.10.2013, at 17:26, Jimmy Lin wrote: >> >> > i have a table like the following: >> > >> > CREATE TABLE log ( >> > mykey timeuuid, >> > type text, >> > msg text, >> > primary key(mykey, type) >> > ); >> > >> > I want to page through all the results from the table using >> >> Have you considered the new build-in paging support: >> >> http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0 >> >> Jan >> >> > >> > select * from log where token(mykey) > token(maxTimeuuid(xxxxx)) limit >> 100; >> > >> >> >> > (where xxx is 0 for the first query, and next one to be the time of the >> mykey(timeuuid) from the last query result) >> > >> > But i seem to get random result. >> > >> > #1 >> > is the above logic make sense for timeuuid type pagination? >> > >> > #2 >> > when we use token in the where clase, is the result return sorted? >> > e.g >> > where token(k) > token(4) AND token(k) < token(10) limit 3 >> > >> > k=5, k=6, k=7 >> > or >> > k=7, k=5, k=9 >> > >> > ? >> > >> > I see lot of article use LIMIT to achieve page size, but if the result >> is not sorted, then it is possible to miss item? >> > >> > >> > thanks >> > >> > >> >> > --089e0160b5e482b11f04e7b038db Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
unfortunately, i have to stick with 1.2 for now for a= while.
=A0
So I am looking for the old fashion way to = do the pagination correctly.
=A0
I think i follow most = of the articles on how to paging through a table, but maybe have some silly= gap that don't give me the correct behavior or it is timeuuid not work= ing for token function?
=A0


On Tue, Oct 1, 2013 at 8:57 AM, David Ward <david@shareablee.com= > wrote:
2.0 has a lot of really exc= iting stuff, unfortunately 2.0 has a lot of really exciting stuff that may = increase the risk of updating to 2.0 just yet.


=
On Tue, Oct 1, 2013 at 9:30 AM, Jan Algermissen <jan.algermissen@= nordsc.com> wrote:
Jimmy,

On 01.10.2013, at 17:26, Jimmy Lin <y2klyf+work@gmail.com> wrote:

> i have a table like the following:
>
> CREATE TABLE log (
> mykey timeuuid,
> type text,
> msg text,
> primary key(mykey, type)
> );
>
> I want to page through all the results from the table using

Have you considered the new build-in paging support:

http://www.datastax.com/dev/blog/client-side-= improvements-in-cassandra-2-0

Jan

>
> select * from log where token(mykey) > token(maxTimeuuid(xxxxx)) li= mit 100;
>


> (where xxx is 0 for the first query, and next one to be the time of th= e mykey(timeuuid) from the last query result)
>
> But i seem to get random result.
>
> #1
> is the above logic make sense for timeuuid type pagination?
>
> #2
> when we use token in the where clase, is the result return sorted?
> e.g
> where token(k) > token(4) AND token(k) =A0< token(10) limit 3 >
> k=3D5, k=3D6, k=3D7
> or
> k=3D7, k=3D5, k=3D9
>
> ?
>
> I see lot of article use LIMIT to achieve page size, but if the result= is not sorted, then it is possible to miss item?
>
>
> thanks
>
>



--089e0160b5e482b11f04e7b038db--