From user-return-32275-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Feb 28 23:05:28 2013 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 9D327EC89 for ; Thu, 28 Feb 2013 23:05:28 +0000 (UTC) Received: (qmail 44444 invoked by uid 500); 28 Feb 2013 23:05:26 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 44417 invoked by uid 500); 28 Feb 2013 23:05:26 -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 44408 invoked by uid 99); 28 Feb 2013 23:05:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 23:05:26 +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 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-we0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 23:05:19 +0000 Received: by mail-we0-f172.google.com with SMTP id x10so2040516wey.17 for ; Thu, 28 Feb 2013 15:04:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+BD93lto5TG2jhEY/YGvEgNYt47mD9gV85A3bRiWLUg=; b=MPnNBFU0pJUMQS2DDAJ2/bUg+ZGXgzxE0i4rUx70iCiZvya0fIa+lo0H07Kgl7VWSS AZjQfrm4UA0Ekv+E/bJI57pmzUrdpB4nF2V8iVc5VAkPPj9hiqsC0i3LinWvMyMMED4d Jo2gQlYU3ZBJL2ndyzn4axBQRo07ip0fBvfgj6j4tT9HhWcfi3UpE3RF8W4m3domeG/t 7/3ZHttAK1W+BHDcBWNNQtptz9P/wX9T1n0W2H23e7rBvLMIFdwn9OtwcL7yGFZV6Mz6 6jNQTICM6Rs/JDA628Crx6bnPcpJ4BcSSOB+GGBT/4LASAjL7nOC8/8KuPACcAhOLtFS iWXQ== MIME-Version: 1.0 X-Received: by 10.180.100.169 with SMTP id ez9mr36408787wib.3.1362092699482; Thu, 28 Feb 2013 15:04:59 -0800 (PST) Received: by 10.194.61.137 with HTTP; Thu, 28 Feb 2013 15:04:59 -0800 (PST) In-Reply-To: References: Date: Thu, 28 Feb 2013 18:04:59 -0500 Message-ID: Subject: Re: Query data in a CF within a timestamp range 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 Pseudo code : GregorianCalendar gc = new GregorianCalendar(); DateFormat df = new SimpleDateFormat( "yyyyMMddhhmm'); String reversekey = df.format(gc); set mycolumnfamily['myrow']['mycolumn'] = 'myvalue'; set myreverseindex['$reversekey]['myrow'] = ''; Under rapid insertion this makes hot-spots. Not an easy way around that other then sharding the reverse index. On Thu, Feb 28, 2013 at 5:49 PM, Kasun Weranga wrote: > Hi all, > > I have a column family with some data + timestamp values and I want to query > the column family to fetch data within a timestamp range. AFAIK it is not > better to use secondary index for timestamp due to high cardinality. > > Is there a way to achieve this functionality? > > Thanks, > Kasun.