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 468F010A02 for ; Sat, 22 Mar 2014 03:48:29 +0000 (UTC) Received: (qmail 77994 invoked by uid 500); 22 Mar 2014 03:48:26 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 77472 invoked by uid 500); 22 Mar 2014 03:48:25 -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 77464 invoked by uid 99); 22 Mar 2014 03:48:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Mar 2014 03:48:23 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of 0x6e6562@gmail.com designates 209.85.220.174 as permitted sender) Received: from [209.85.220.174] (HELO mail-vc0-f174.google.com) (209.85.220.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Mar 2014 03:48:18 +0000 Received: by mail-vc0-f174.google.com with SMTP id ld13so3478413vcb.5 for ; Fri, 21 Mar 2014 20:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jD+0YczfDRgDnjrA4mwEaaegazcrYep4jfUGSHYjYjE=; b=VAuGD+Ui/GQ9YvgVDKIrJBf1eLrsW53ue7AzzkRpiAJr2U29DQTqE1r0MCRL3ACulw h6QjFYoKrbBkDXNB/thVllhguk+rNWKQdqaYFqpsIMK/yOtGrymWdUY8j+kXvtRDlici 5cdSZx3ISYY1qhQ5vV+Bz8ruGiaQj761IAla9w6YVsNTw/ogthAts/r2RzfnwRvEaGc0 5x7ca00cZ9O3GHvuTHU5LfJ/FcdZPdPkj87rkKgtJIuLFF8hVZDK4/JB+ohK/B1hm5hl YUguP0iORyu+divEXjDq+7wHGduMu4RRIbd/67yXC63ybR8kgMgZJk87eIAl6qZOBOcz +Jmw== MIME-Version: 1.0 X-Received: by 10.58.190.99 with SMTP id gp3mr92342vec.32.1395460077638; Fri, 21 Mar 2014 20:47:57 -0700 (PDT) Received: by 10.58.109.34 with HTTP; Fri, 21 Mar 2014 20:47:57 -0700 (PDT) In-Reply-To: References: Date: Sat, 22 Mar 2014 03:47:57 +0000 Message-ID: Subject: Re: Data model for boolean attributes From: Ben Hood <0x6e6562@gmail.com> To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hey Duy Hai, On Fri, Mar 21, 2014 at 7:34 PM, DuyHai Doan wrote: > Your previous "select * from x where flag = true;" translate into: > > SELECT * FROM x WHERE id=... AND flag = true > > Of course, you'll need to provide the id in any case. This is an interesting option, though this app needs to be able to paginate through all values of (id,flag). In this variant I guess you could do select distinct id,flag from x to get the unique partition keys and use those to paginate through the column family > If you want to query only on the boolean flag, I'm afraid that manual > indexing or secondary index (beware of cardinality !) are your only choices. When you say beware of the cardinality, do you think that the cardinality is too low in this instance? Also, how is secondary indexing or manual indexing better than maintaining a separate column family per flag (since there will only be two column families in this case)? Cheers, Ben