You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by shubham srivastava <sh...@gmail.com> on 2013/04/04 03:23:32 UTC
Data Model and Query
Hi,
Whats the recommendation on querying a data model like StartDate > “X” and
counter > “Y” . Its kind of range queries across multiple columns and key.
I have the flexibility for modelling the data for the above
query accordingly.
Regards,
Shubham
Re: Data Model and Query
Posted by "Hiller, Dean" <De...@nrel.gov>.
I would partition either with cassandra's partitioning or PlayOrm partitioning and query like so
Where beginOfMonth=xxxxx and startDate>"X" and counter > "Y". This only returns stuff after X in that partition though so you may need to run multiple queries like this and if you have billions of rows it could take some time….instead you may want startData > X and startDate < Z such that Z and X are in the same month or if they span 2-3 partitions, then just run the 2-3 queries. I don't know enough detail on your use case to know if this works for you though.
Dean
From: aaron morton <aa...@thelastpickle.com>>
Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <us...@cassandra.apache.org>>
Date: Friday, April 5, 2013 10:59 AM
To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <us...@cassandra.apache.org>>
Subject: Re: Data Model and Query
Whats the recommendation on querying a data model like StartDate > “X” and counter > “Y” .
it's not possible.
If you are using secondary indexes you have to have an equals clause in the statement.
Cheers
-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 4/04/2013, at 6:53 AM, shubham srivastava <sh...@gmail.com>> wrote:
Hi,
Whats the recommendation on querying a data model like StartDate > “X” and counter > “Y” . Its kind of range queries across multiple columns and key.
I have the flexibility for modelling the data for the above query accordingly.
Regards,
Shubham
Re: Data Model and Query
Posted by aaron morton <aa...@thelastpickle.com>.
> Whats the recommendation on querying a data model like StartDate > “X” and counter > “Y” .
>
>
it's not possible.
If you are using secondary indexes you have to have an equals clause in the statement.
Cheers
-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 4/04/2013, at 6:53 AM, shubham srivastava <sh...@gmail.com> wrote:
> Hi,
>
>
> Whats the recommendation on querying a data model like StartDate > “X” and counter > “Y” . Its kind of range queries across multiple columns and key.
>
> I have the flexibility for modelling the data for the above query accordingly.
>
>
>
> Regards,
>
> Shubham
>