Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D7414200B8D for ; Fri, 23 Sep 2016 12:24:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D5C74160ACA; Fri, 23 Sep 2016 10:24:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E929C160AC2 for ; Fri, 23 Sep 2016 12:24:54 +0200 (CEST) Received: (qmail 81963 invoked by uid 500); 23 Sep 2016 10:24:53 -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 81952 invoked by uid 99); 23 Sep 2016 10:24:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2016 10:24:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id F210BC05F7 for ; Fri, 23 Sep 2016 10:24:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JaaWWZAxWPTK for ; Fri, 23 Sep 2016 10:24:50 +0000 (UTC) Received: from mail-ua0-f180.google.com (mail-ua0-f180.google.com [209.85.217.180]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id A64AE5FB08 for ; Fri, 23 Sep 2016 10:24:49 +0000 (UTC) Received: by mail-ua0-f180.google.com with SMTP id q42so32930392uaq.1 for ; Fri, 23 Sep 2016 03:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=7JkRr3VDmiV+wCDSEtuijtvNiw/SaZziYGvj6HXJ3tk=; b=PF1fGNmotpPOu7Up4qkIrwapqSXEGSXgwQt9o8oUFxBpXS6gqQRdNMdor0vqV+PGBS QaugRTsUOVeeFHzusSr4sdYPZ+8qXZ+zkGySSpwXalgwZNpcPny7S3FlBCGm6KRAv3kF xErIPjFlu53ejm2w7WBy+4UH5VmdPZyE12Hdj3cpowcugl8VbB6bfviaRPhEnO99aoXR F1tUKTILxWS1X54CuYa8Kz/vQy3jYwPxEGVFQK7XSEKne/G0tp7iYmmVRtWTwUsQmHqD Z1mj9Xy4FhiSuY/yqn05rTsxDqFis0obghe3clfT0e7XYHXVO6f2o4hFwwWzPHNBlgbn 0z+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=7JkRr3VDmiV+wCDSEtuijtvNiw/SaZziYGvj6HXJ3tk=; b=S0ofLGCEyV8lqvo1xAuBfMcybgA52E7Hv/germVbjWvl2uMG/9w69Rp8g/crXqIqOy mgzdFx5b6ZurCShoMu7r2VqupWKcI/47W38DS8U+fus5IQyaz44vJTW7w0vN/ia5SSm9 6guwar3epTyv1EDC1PlETko9zYeSgHc98L24lyNyLDPg9taBXzLqcSgHqvr1JsYbZpPM JC8guet+n+3jYeBYONHul/duYKG1EgyWhrm+V/gF8Wre+cVdx5ZlmBa1WpYLb5SD8feD YGrzXLJZoQ7MYOWfGtBZY2M0CgD+/moDNFYzsU4LfUctmLFjeDnglzc/Xx6Qbg3GcTpG Pz0Q== X-Gm-Message-State: AA6/9Rl1c5cvEU992uO8ZyNUxkwjUnjmJm17TGMCGN6EFBkqZL9R2W6Tx2BLxKYOjJLvjPZ7Dxf/2u9YkCkrFg== X-Received: by 10.176.3.82 with SMTP id 76mr2968963uat.34.1474626288456; Fri, 23 Sep 2016 03:24:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.38.116 with HTTP; Fri, 23 Sep 2016 03:24:28 -0700 (PDT) In-Reply-To: <38BAB08C-1213-454D-889B-993DC06AADCE@gmail.com> References: <38BAB08C-1213-454D-889B-993DC06AADCE@gmail.com> From: Alain RODRIGUEZ Date: Fri, 23 Sep 2016 12:24:28 +0200 Message-ID: Subject: Re: Help on temporal data modeling To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a113d0aca199b19053d2a307d archived-at: Fri, 23 Sep 2016 10:24:56 -0000 --001a113d0aca199b19053d2a307d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Denis, You might want to have a look at - Materialized views http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views - Secondary index https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html My 2 cents: make sure to understand the implications before moving forward, what is happening under the hood or at least that your use case fits with the recommendations. Indexes and views are not free. If you want to know more, you might want to watch this: https://www.youtube.com/watch?v=3DdxiuQ2CkXfM from DuyHai at the summit thi= s year :-). C*heers, ----------------------- Alain Rodriguez - @arodream - alain@thelastpickle.com France The Last Pickle - Apache Cassandra Consulting http://www.thelastpickle.com 2016-09-23 10:42 GMT+02:00 Denis Mikhaylov : > Hi! > > I have question regarding data modelling. > > Let=E2=80=99s say that I have `subscriptions` table with two columns > `subscription_id text` and `next_billing_date timestamp`. > > How do I model a table to efficiently query all subscriptions due today > (something like `where next_billing_date <=3D today`) --001a113d0aca199b19053d2a307d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

My 2 cents: make sur= e to understand the implications before moving forward, what is happening u= nder the hood or at least that your use case fits with the recommendations.= Indexes and views are not free. If you want to know more, you might want t= o watch this:=C2=A0https://www.youtube.com/watch?v=3DdxiuQ2CkXfM from DuyHai at the summ= it this year :-).

C*heers,
-----------------------
Alain Rodriguez - @arodream - alain@thelastpickle.com
F= rance

The Last Pickle - Apache Cassandra Consultin= g

2016-09-23 10:42 GMT+02:00 Denis Mikhaylov <= ;notxcain@gmail.com= >:
Hi!

I have question regarding data modelling.

Let=E2=80=99s say that I have `subscriptions` table with two columns `subsc= ription_id text` and `next_billing_date timestamp`.

How do I model a table to efficiently query all subscriptions due today (so= mething like `where next_billing_date <=3D today`)
--001a113d0aca199b19053d2a307d--