You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by david lee <ie...@gmail.com> on 2011/05/25 10:42:36 UTC
"range query" vs "slice range query"
hi guys,
i'm reading up on the book "Cassandra - Definitive guide"
and i don't seem to understand what it says about "ranges and slices"
my understanding is
a range as in "a mathematical range to define a subset from an ordered set
of elements",
in cassandra typically means a range of rows whereas
a slice means a range of columns.
a range query refers to a query to retrieve a range of rows whereas
a slice range queyr refers to a query to retrieve range of columns within a
row.
i may be talking about total nonsense but i really am more confused after
reading this portion of the book
http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
many thanx in advance
david
Re: "range query" vs "slice range query"
Posted by david lee <ie...@gmail.com>.
so, that was actually simpler than i thought ay?
cheers guys~
On 26 May 2011 05:38, Roland Gude <ro...@yoochoose.com> wrote:
> That is correct. Random partitioner orders rows according to the MD5 sum.
>
> Am 25.05.2011 um 16:11 schrieb "Robert Jackson" <robertj@promedicalinc.com
> >:
>
> Also, it is my understanding that if you are not using
> OrderPreservingPartitioner a get_range_slices may not return what you would
> expect.
>
> With the RandomPartitioner you can iterate over the complete list by using
> the last row key as the start for subsequent requests, but if you are using
> a single query you will be returned all the rows where the returned row
> key's md5 is between the md5 of the start row key and stop row key.
>
> Reference:
> http://wiki.apache.org/cassandra/FAQ - "Why aren't range slices/sequential
> scans giving me the expected results?"
>
> Robert Jackson
>
> ------------------------------
> *From: *"Jonathan Ellis" <jb...@gmail.com>
> *To: *user@cassandra.apache.org
> *Sent: *Wednesday, May 25, 2011 8:54:34 AM
> *Subject: *Re: "range query" vs "slice range query"
>
> get_range_slices is the api to get a slice (of columns) from each of a
> range (of rows)
>
> On Wed, May 25, 2011 at 3:42 AM, david lee <ie...@gmail.com> wrote:
> > hi guys,
> > i'm reading up on the book "Cassandra - Definitive guide"
> > and i don't seem to understand what it says about "ranges and slices"
> > my understanding is
> > a range as in "a mathematical range to define a subset from an ordered
> set
> > of elements",
> > in cassandra typically means a range of rows whereas
> > a slice means a range of columns.
> > a range query refers to a query to retrieve a range of rows whereas
> > a slice range queyr refers to a query to retrieve range of columns within
> a
> > row.
> > i may be talking about total nonsense but i really am more confused after
> > reading this portion of the book
> >
> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
> > many thanx in advance
> > david
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>
>
Re: "range query" vs "slice range query"
Posted by Roland Gude <ro...@yoochoose.com>.
That is correct. Random partitioner orders rows according to the MD5 sum.
Am 25.05.2011 um 16:11 schrieb "Robert Jackson" <ro...@promedicalinc.com>>:
Also, it is my understanding that if you are not using OrderPreservingPartitioner a get_range_slices may not return what you would expect.
With the RandomPartitioner you can iterate over the complete list by using the last row key as the start for subsequent requests, but if you are using a single query you will be returned all the rows where the returned row key's md5 is between the md5 of the start row key and stop row key.
Reference:
http://wiki.apache.org/cassandra/FAQ - "Why aren't range slices/sequential scans giving me the expected results?"
Robert Jackson
________________________________
From: "Jonathan Ellis" <jb...@gmail.com>>
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Sent: Wednesday, May 25, 2011 8:54:34 AM
Subject: Re: "range query" vs "slice range query"
get_range_slices is the api to get a slice (of columns) from each of a
range (of rows)
On Wed, May 25, 2011 at 3:42 AM, david lee <ie...@gmail.com> wrote:
> hi guys,
> i'm reading up on the book "Cassandra - Definitive guide"
> and i don't seem to understand what it says about "ranges and slices"
> my understanding is
> a range as in "a mathematical range to define a subset from an ordered set
> of elements",
> in cassandra typically means a range of rows whereas
> a slice means a range of columns.
> a range query refers to a query to retrieve a range of rows whereas
> a slice range queyr refers to a query to retrieve range of columns within a
> row.
> i may be talking about total nonsense but i really am more confused after
> reading this portion of the book
> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
> many thanx in advance
> david
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: "range query" vs "slice range query"
Posted by Robert Jackson <ro...@promedicalinc.com>.
Also, it is my understanding that if you are not using OrderPreservingPartitioner a get_range_slices may not return what you would expect.
With the RandomPartitioner you can iterate over the complete list by using the last row key as the start for subsequent requests, but if you are using a single query you will be returned all the rows where the returned row key's md5 is between the md5 of the start row key and stop row key.
Reference:
http://wiki.apache.org/cassandra/FAQ - " Why aren't range slices/sequential scans giving me the expected results?"
Robert Jackson
----- Original Message -----
From: "Jonathan Ellis" <jb...@gmail.com>
To: user@cassandra.apache.org
Sent: Wednesday, May 25, 2011 8:54:34 AM
Subject: Re: "range query" vs "slice range query"
get_range_slices is the api to get a slice (of columns) from each of a
range (of rows)
On Wed, May 25, 2011 at 3:42 AM, david lee <ie...@gmail.com> wrote:
> hi guys,
> i'm reading up on the book "Cassandra - Definitive guide"
> and i don't seem to understand what it says about "ranges and slices"
> my understanding is
> a range as in "a mathematical range to define a subset from an ordered set
> of elements",
> in cassandra typically means a range of rows whereas
> a slice means a range of columns.
> a range query refers to a query to retrieve a range of rows whereas
> a slice range queyr refers to a query to retrieve range of columns within a
> row.
> i may be talking about total nonsense but i really am more confused after
> reading this portion of the book
> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
> many thanx in advance
> david
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: "range query" vs "slice range query"
Posted by Jonathan Ellis <jb...@gmail.com>.
get_range_slices is the api to get a slice (of columns) from each of a
range (of rows)
On Wed, May 25, 2011 at 3:42 AM, david lee <ie...@gmail.com> wrote:
> hi guys,
> i'm reading up on the book "Cassandra - Definitive guide"
> and i don't seem to understand what it says about "ranges and slices"
> my understanding is
> a range as in "a mathematical range to define a subset from an ordered set
> of elements",
> in cassandra typically means a range of rows whereas
> a slice means a range of columns.
> a range query refers to a query to retrieve a range of rows whereas
> a slice range queyr refers to a query to retrieve range of columns within a
> row.
> i may be talking about total nonsense but i really am more confused after
> reading this portion of the book
> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
> many thanx in advance
> david
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: "range query" vs "slice range query"
Posted by Roland Gude <ro...@yoochoose.com>.
I cannot Display the Book page you are referring to, but your General understanding is correct. A Range Refers to several rows, a slice Refers to several columns. A RangeSlice is a combination of Both. From all rows in a Range get a specific slice of columns.
Am 25.05.2011 um 10:43 schrieb "david lee" <ie...@gmail.com>>:
hi guys,
i'm reading up on the book "Cassandra - Definitive guide"
and i don't seem to understand what it says about "ranges and slices"
my understanding is
a range as in "a mathematical range to define a subset from an ordered set of elements",
in cassandra typically means a range of rows whereas
a slice means a range of columns.
a range query refers to a query to retrieve a range of rows whereas
a slice range queyr refers to a query to retrieve range of columns within a row.
i may be talking about total nonsense but i really am more confused after reading this portion of the book
<http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false>http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA134&lpg=PA134&dq=cassandra+%22range+query%22+%22range+slice%22&source=bl&ots=XoPB4uA60u&sig=uDDoQe0FRkQobHnr-vPvvQ3B8TQ&hl=en&ei=ub3cTcvGLZLevQOuxs3CDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCwQ6AEwAw#v=onepage&q=cassandra%20%22range%20query%22%20%22range%20slice%22&f=false
many thanx in advance
david