>
> So that means more than one nodes can be selected to fulfill a range query
> based on the token, correct?


Yes. When doing a token range query Cassandra will need to send requests to
any node that owns part of the token range requested. This could be just
one set of replicas or more, depending on how your token ring is arranged.
You could avoid querying multiple nodes by limiting the token() calls to be
within one token range.

And, then entire partition on each node will be searched based on the
> clustering key (i.e. "time" in this case).

No. it will skip to the section of the partition with time = '12:00'.
Cassandra should be smart enough to avoid reading the whole partition.


On 31 January 2018 at 06:57, Tyagi, Preetika <preetika.ty...@intel.com>
wrote:

> So that means more than one nodes can be selected to fulfill a range query
> based on the token, correct?
>
> I was looking at this link: https://www.datastax.com/dev/
> blog/a-deep-look-to-the-cql-where-clause
>
> In the example query,
> SELECT * FROM numberOfRequests
>     WHERE token(cluster, date) > token('cluster1', '2015-06-03')
>     AND token(cluster, date) <= token('cluster1', '2015-06-05')
>     AND time = '12:00'
>
> More than one nodes might get picked for this token based range query.
> And, then entire partition on each node will be searched based on the
> clustering key (i.e. "time" in this case).
> Is my understanding correct?
>
> Thanks,
> Preetika
>
> -----Original Message-----
> From: J. D. Jordan [mailto:jeremiah.jor...@gmail.com]
> Sent: Tuesday, January 30, 2018 10:13 AM
> To: dev@cassandra.apache.org
> Subject: Re: range queries on partition key supported?
>
> A range query can be performed on the token of a partition key, not on the
> value.
>
> -Jeremiah
>
> > On Jan 30, 2018, at 12:21 PM, Tyagi, Preetika <preetika.ty...@intel.com>
> wrote:
> >
> > Hi All,
> >
> > I have a quick question on Cassandra's behavior in case of partition
> keys. I know that range queries are allowed in general, however, is it also
> allowed on partition keys as well? The partition key is used as an input to
> determine a node in a cluster, so I'm wondering how one can possibly
> perform range query on that.
> >
> > Thanks,
> > Preetika
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@cassandra.apache.org
> For additional commands, e-mail: dev-h...@cassandra.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@cassandra.apache.org
> For additional commands, e-mail: dev-h...@cassandra.apache.org
>
>

Reply via email to