You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by kh jo <jo...@yahoo.com> on 2011/01/17 11:55:04 UTC
Between Clause
What is the best way to model a query with between clause.. given that you have a large number of entries...
thanks
Jo
Re: Between Clause
Posted by kh jo <jo...@yahoo.com>.
another example: generating visit statistics given that start and end date are dynamic
--- On Mon, 1/17/11, kh jo <jo...@yahoo.com> wrote:
From: kh jo <jo...@yahoo.com>
Subject: Re: Between Clause
To: user@cassandra.apache.org
Date: Monday, January 17, 2011, 12:40 PM
example: finding country from IP address
Mysql: I have table with 140,000 rows each with ipNumStart, IpNumEnd, Country
so to find the country I use:
WHERE ipNum BETWEEN ipNumStart AND ipNumEnd
ipNumStart ipNumEnd Country
16777216
17301503 Australia
18939904
19005439 Japan
etc
etc
etc
--- On Mon, 1/17/11, aaron morton <aa...@thelastpickle.com> wrote:
From: aaron morton <aa...@thelastpickle.com>
Subject: Re: Between Clause
To: user@cassandra.apache.org
Date: Monday, January 17, 2011, 12:24 PM
Can you provide some more information ?
Aaron
On 17/01/2011, at 11:55 PM, kh jo wrote:
What is the best way to model a query with between clause.. given that you have a large number of entries...
thanks
Jo
Re: Between Clause
Posted by kh jo <jo...@yahoo.com>.
example: finding country from IP address
Mysql: I have table with 140,000 rows each with ipNumStart, IpNumEnd, Country
so to find the country I use:
WHERE ipNum BETWEEN ipNumStart AND ipNumEnd
ipNumStart ipNumEnd Country
16777216
17301503 Australia
18939904
19005439 Japan
etc
etc
etc
--- On Mon, 1/17/11, aaron morton <aa...@thelastpickle.com> wrote:
From: aaron morton <aa...@thelastpickle.com>
Subject: Re: Between Clause
To: user@cassandra.apache.org
Date: Monday, January 17, 2011, 12:24 PM
Can you provide some more information ?
Aaron
On 17/01/2011, at 11:55 PM, kh jo wrote:
What is the best way to model a query with between clause.. given that you have a large number of entries...
thanks
Jo
Re: Between Clause
Posted by aaron morton <aa...@thelastpickle.com>.
Can you provide some more information ?
Aaron
On 17/01/2011, at 11:55 PM, kh jo wrote:
> What is the best way to model a query with between clause.. given that you have a large number of entries...
>
> thanks
> Jo
>
>
Re: Between Clause
Posted by Donal Zang <za...@ihep.ac.cn>.
On 17/01/2011 11:55, kh jo wrote:
> What is the best way to model a query with between clause.. given that
> you have a large number of entries...
>
> thanks
> Jo
>
>
In my experience,for the row based 'between clause' with a random
partition, you should design the column family carefully, So that you
can get all the rows' key.
In this case you can use a multi_get() instead of get_range(), and you
can do get_range() between columns in a row.
--