You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Tyler Hobbs (JIRA)" <ji...@apache.org> on 2014/12/18 19:24:13 UTC

[jira] [Commented] (CASSANDRA-8509) Range queries/ORDER BY should be possible with a secondary index for a single row

    [ https://issues.apache.org/jira/browse/CASSANDRA-8509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251983#comment-14251983 ] 

Tyler Hobbs commented on CASSANDRA-8509:
----------------------------------------

Your understanding is correct, it should be possible to provide this.

> Range queries/ORDER BY should be possible with a secondary index for a single row
> ---------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8509
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8509
>             Project: Cassandra
>          Issue Type: Improvement
>         Environment: Linux server latest debian release
>            Reporter: Jason Kania
>            Priority: Minor
>
> For instances when time series data is being stored and a single row retrieved, it should be possible to use range queries and ORDER BY with a second index:
> {code}
> CREATE TABLE somedata (
> subscriberId varchar,
> unitId int,
> event varchar,
> severity int, //1, 2, or 3
> time timestamp,
> PRIMARY KEY ((subscriberId, unitId), time)
> );{code}
> {code}CREATE INDEX somedataindex ON somedata (severity);{code}
> {code}SELECT * FROM somedata WHERE subscriberId=? AND unitId=? AND severity=?
> AND time>=? AND time<=? ORDER BY time;{code}
> If my understanding of the architecture is correct, this should not encounter the limitations of the secondary index being a hash with data spread over multiple partitions. If this is limited by the architecture, please help me understand why. I see having this functionality as opening up a number of additional possibilities in using the secondary indices.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)