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 542CDD8BA for ; Fri, 12 Oct 2012 14:21:05 +0000 (UTC) Received: (qmail 98146 invoked by uid 500); 12 Oct 2012 14:21:02 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 98126 invoked by uid 500); 12 Oct 2012 14:21:02 -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 98118 invoked by uid 99); 12 Oct 2012 14:21:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2012 14:21:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of derek@fyrie.net designates 72.14.182.177 as permitted sender) Received: from [72.14.182.177] (HELO sikozu.fyrie.net) (72.14.182.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2012 14:20:55 +0000 Received: from mail-vc0-f172.google.com ([209.85.220.172]) by sikozu.fyrie.net with esmtpsa (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.76) (envelope-from ) id 1TMg6L-0003UR-Vb for user@cassandra.apache.org; Fri, 12 Oct 2012 08:20:34 -0600 Received: by mail-vc0-f172.google.com with SMTP id fl11so3936184vcb.31 for ; Fri, 12 Oct 2012 07:20:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.38.73 with SMTP id a9mr2595604vce.72.1350051628003; Fri, 12 Oct 2012 07:20:28 -0700 (PDT) Received: by 10.58.32.202 with HTTP; Fri, 12 Oct 2012 07:20:27 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Oct 2012 08:20:27 -0600 Message-ID: Subject: Re: Option for ordering columns by timestamp in CF From: Derek Williams To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec54ee444b72f9704cbdd633c --bcaec54ee444b72f9704cbdd633c Content-Type: text/plain; charset=UTF-8 You probably already know this but I'm pretty sure it wouldn't be a trivial change, since to efficiently lookup a column by name requires the columns to be ordered by name. A separate index would be needed in order to provide lookup by column name if the row was sorted by timestamp (which is the way Redis implements it's sorted set). On Fri, Oct 12, 2012 at 12:13 AM, Ertio Lew wrote: > "Make column timestamps optional"- kidding me, right ?:) I do understand > that this wont be possible as then cassandra wont be able to distinguish > the latest among several copies of same column. I dont mean that. I just > want the while ordering the columns, Cassandra(in an optional mode per CF) > should not look at column names(they will exist though but for retrieval > purposes not for ordering) but instead Cassandra would order the columns by > looking at the timestamp values(timestamps would exist!). So the change > would be just to provide a mode in which cassandra, while ordering, uses > timestamps instead of column names. > > > On Fri, Oct 12, 2012 at 2:26 AM, Tyler Hobbs wrote: > >> Without thinking too deeply about it, this is basically equivalent to >> disabling timestamps for a column family and using timestamps for column >> names, though in a very indirect (and potentially confusing) manner. So, >> if you want to open a ticket, I would suggest framing it as "make column >> timestamps optional". >> >> >> On Wed, Oct 10, 2012 at 4:44 AM, Ertio Lew wrote: >> >>> I think Cassandra should provide an configurable option on per column >>> family basis to do columns sorting by time-stamp rather than column names. >>> This would be really helpful to maintain time-sorted columns without using >>> up the column name as time-stamps which might otherwise be used to store >>> most relevant column names useful for retrievals. Very frequently we need >>> to store data sorted in time order. Therefore I think this may be a very >>> general requirement & not specific to just my use-case alone. >>> >>> Does it makes sense to create an issue for this ? >>> >>> >>> >>> >>> On Fri, Mar 25, 2011 at 2:38 AM, aaron morton wrote: >>> >>>> If you mean order by the column timestamp (as passed by the client) >>>> that it not possible. >>>> >>>> Can you use your own timestamps as the column name and store them as >>>> long values ? >>>> >>>> Aaron >>>> >>>> On 25 Mar 2011, at 09:30, Narendra Sharma wrote: >>>> >>>> > Cassandra 0.7.4 >>>> > Column names in my CF are of type byte[] but I want to order columns >>>> by timestamp. What is the best way to achieve this? Does it make sense for >>>> Cassandra to support ordering of columns by timestamp as option for a >>>> column family irrespective of the column name type? >>>> > >>>> > Thanks, >>>> > Naren >>>> >>>> >>> >> >> >> -- >> Tyler Hobbs >> DataStax >> >> > -- Derek Williams --bcaec54ee444b72f9704cbdd633c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You probably already know this but I'm pretty sure it wouldn't be a= trivial change, since to efficiently lookup a column by name requires the = columns to be ordered by name. A separate index would be needed in order to= provide lookup by column name if the row was sorted by timestamp (which is= the way Redis implements it's sorted set).

On Fri, Oct 12, 2012 at 12:13 AM, Ertio Lew = <ertiop93@gmail.com> wrote:
"Make column timestamps optional"- kidding me, right ?:) =C2=A0I = do understand that this wont be possible as then cassandra wont be able to = distinguish the latest among several copies of same column. I dont mean tha= t. I just want the while ordering the columns, Cassandra(in an optional mod= e per CF) should not look at column names(they will exist though but for re= trieval purposes not for ordering) but instead Cassandra would order the co= lumns by looking at the timestamp values(timestamps would exist!). So the c= hange would be just to provide a mode in which cassandra,=C2=A0while orderi= ng,=C2=A0uses timestamps instead of column names.


On Fri, Oct 12, 2012 at 2:26 AM, Tyler Hobbs= <tyler@datastax.com> wrote:
Without thinking too deeply about it, this is basically equivalent to disab= ling timestamps for a column family and using timestamps for column names, = though in a very indirect (and potentially confusing) manner.=C2=A0 So, if = you want to open a ticket, I would suggest framing it as "make column = timestamps optional".


On Wed, Oct 10, 2012 at 4:44 AM, Ertio Lew <= span dir=3D"ltr"><ertiop93@gmail.com> wrote:
On Fri, Mar 25, 2= 011 at 2:38 AM, aaron morton <aaron@thelastpickle.com>= wrote:
If you mean order by the column timestamp (a= s passed by the client) that it not possible.

Can you use your own timestamps as the column name and store them as long v= alues ?

Aaron

On 25 Mar 2011, at 09:30, Narendra Sharma wrote:

> Cassandra 0.7.4
> Column names in my CF are of type byte[] but I want to order columns b= y timestamp. What is the best way to achieve this? Does it make sense for C= assandra to support ordering of columns by timestamp as option for a column= family irrespective of the column name type?
>
> Thanks,
> Naren





--
Tyler Hobbs
DataStax
<= br>




--
=
Derek Williams

--bcaec54ee444b72f9704cbdd633c--