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 DB6C510853 for ; Wed, 19 Jun 2013 17:06:06 +0000 (UTC) Received: (qmail 5964 invoked by uid 500); 19 Jun 2013 17:06:03 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 5946 invoked by uid 500); 19 Jun 2013 17:06: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 5935 invoked by uid 99); 19 Jun 2013 17:06:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 17:06:02 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cjbottaro@academicworks.com designates 209.85.128.170 as permitted sender) Received: from [209.85.128.170] (HELO mail-ve0-f170.google.com) (209.85.128.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 17:05:57 +0000 Received: by mail-ve0-f170.google.com with SMTP id 14so4307799vea.29 for ; Wed, 19 Jun 2013 10:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=academicworks.com; s=google; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type; bh=e9ZLwzumeTcN20Va9z/gWgnI9bldysxMZXIrL9uqufw=; b=VXKWYSy6aNXB36Dl0HsLPzhQ6qDP9jU0OXq2aTQmvBZ2SnrtIfIcHozfF+R9uG9iAL 5lyxBeamFGbU0WDN7UQCM+niO0TGbqED0WmL8d5MMcJwqWObtKMjIHxbv89GhJjkTzPJ XUdsUUX4xBfPHz883ytJPNbM4fgsq6zCXthG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=e9ZLwzumeTcN20Va9z/gWgnI9bldysxMZXIrL9uqufw=; b=EqaZwolw08thrXC1M0UJozBwF4J42tDnh/9VpeSrM8vPmvUqMJYbK+RhsqmAxa953E BDLQEiaVgi8i914bbQRbXiO01n7Umc1JAtUv0Bmb9+S8QPaQ1M6iOP4wgkcGkwbvsr/0 JkIC4rvih/O72FVcCUetcaJUbuCHSPG9/ILmfYfpQ1GKLI01HkRqY3zPn0VDGaeZKPXG 2JVAojda+PP+pdneLb4CkKw5bF2P0DeGD394F6Tdl8fOYwHY3UF/WcG7lOHoGE0F2Rai xrNzk3ApWLLWiAsT51GgWjR9QfIGT7cbF1OyUDbzUEebVC+4S6vQQavpc6Zs7B1XJn87 1O7A== MIME-Version: 1.0 X-Received: by 10.52.0.52 with SMTP id 20mr1059006vdb.22.1371661536425; Wed, 19 Jun 2013 10:05:36 -0700 (PDT) Received: by 10.58.198.169 with HTTP; Wed, 19 Jun 2013 10:05:36 -0700 (PDT) X-Originating-IP: [65.36.85.58] Date: Wed, 19 Jun 2013 12:05:36 -0500 Message-ID: Subject: Date range queries From: "Christopher J. Bottaro" To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7bacbce8a1884a04df84d6f4 X-Gm-Message-State: ALoCoQmBGRaqax5jMr9/ieQg6HsFWEGlVXBGx3J1nhlaP/CWpyMCVW+xpmFv4zaiWSTmv+Z8iw1Z X-Virus-Checked: Checked by ClamAV on apache.org --047d7bacbce8a1884a04df84d6f4 Content-Type: text/plain; charset=ISO-8859-1 Hello, We are considering using Cassandra and I want to make sure our use case fits Cassandra's strengths. We have the table like: answers ------- user_id | question_id | result | created_at Where our most common query will be something like: SELECT * FROM answers WHERE user_id = 123 AND created_at > '01/01/2012' AND created_at < '01/01/2013' Sometimes we will also limit by a question_id or a list of question_ids. Secondary indexes will be created on user_id and question_id. We expect the upper bound of number of answers for a given user to be around 10,000. Now my understanding of how Cassandra will run the aforementioned query is that it will load all the answers for a given user into memory using the secondary index, then scan over that set filtering based on the dates. Considering that that will be our most used query and it will happen very often, is this a bad use case for Cassandra? Thanks for the help. --047d7bacbce8a1884a04df84d6f4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

We are considering using Cassand= ra and I want to make sure our use case fits Cassandra's strengths. =A0= We have the table like:

answers
-------
user_id | question_id | result |= created_at

Where our most comm= on query will be something like:

SELEC= T * FROM answers WHERE user_id =3D 123 AND created_at > '01/01/2012&= #39; AND created_at < '01/01/2013'

Sometimes we will also limit by a question_id or a list of quest= ion_ids.

Secondary indexes will be cre= ated on user_id and question_id. =A0We expect the upper bound of number of = answers for a given user to be around 10,000.

Now my understanding of how Cassandra will = run the aforementioned query is that it will load all the answers for a giv= en user into memory using the secondary index, then scan over that set filt= ering based on the dates.

Considering that that will be our most used= query and it will happen very often, is this a bad use case for Cassandra?=

Thanks for the help.
--047d7bacbce8a1884a04df84d6f4--