Whoa!

BAD BOY. This isn’t a good idea for secondary index. 

You have a row key (primary index) which is time. 
The secondary is a filter… with 3 choices. 

HINT: Do you really want a secondary index based on a field that only has 3 
choices for a value? 

What are they teaching in school these days? 

How about applying a server side filter?  ;-) 



On May 18, 2014, at 12:33 PM, John Hancock <jhancock1...@gmail.com> wrote:

> Shushant,
> 
> Here's one idea, there might be better ways.
> 
> Take a look at phoenix it supports secondary indexing:
> http://phoenix.incubator.apache.org/secondary_indexing.html
> 
> -John
> 
> 
> On Sat, May 17, 2014 at 8:34 AM, Shushant Arora
> <shushantaror...@gmail.com>wrote:
> 
>> Hi
>> 
>> I have a requirement to query my data base on date and user category.
>> User category can be Supreme,Normal,Medium.
>> 
>> I want to query how many new users are there in my table from date range
>> (2014-01-01) to (2014-05-16) category wise.
>> 
>> Another requirement is to query how many users of Supreme category are
>> there in my table Broken down wise month in which they came.
>> 
>> What should be my key
>> 1.If i take key as combination of date#category. I cannot query based on
>> category?
>> 2.If I take key as category#date I cannot query based on date.
>> 
>> 
>> Thanks
>> Shushant.
>> 

Reply via email to