incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hood <0x6e6...@gmail.com>
Subject Re: Data model for boolean attributes
Date Sat, 22 Mar 2014 03:47:57 GMT
Hey Duy Hai,

On Fri, Mar 21, 2014 at 7:34 PM, DuyHai Doan <doanduyhai@gmail.com> 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

Mime
View raw message