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

[jira] [Updated] (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:all-tabpanel ]

Jason Kania updated CASSANDRA-8509:
-----------------------------------
    Description: 
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:

CREATE TABLE somedata (
subscriberId varchar,
unitId int,
event varchar,
severity int, //1, 2, or 3
time timeuuid,
PRIMARY KEY ((subscriberId, unitId), time)
);

CREATE INDEX somedataindex ON somedata (severity);

SELECT * FROM somedata WHERE subscriberId=? AND unitId=? AND severity=?
AND time>=? AND time<=? ORDER BY TIME

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.

  was:
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:

CREATE TABLE somedata (
subscriberId varchar,
unitId int,
event varchar,
severity int, //1, 2, or 3
time timeuuid,
PRIMARY KEY ((subscriberId, unitId), time)
);

CREATE INDEX somedataindex ON somedata (severity);

SELECT * FROM somedata WHERE subscriberId=? AND unitId=?
WHERE time>=? AND time<=? ORDER BY TIME

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.


> 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:
> CREATE TABLE somedata (
> subscriberId varchar,
> unitId int,
> event varchar,
> severity int, //1, 2, or 3
> time timeuuid,
> PRIMARY KEY ((subscriberId, unitId), time)
> );
> CREATE INDEX somedataindex ON somedata (severity);
> SELECT * FROM somedata WHERE subscriberId=? AND unitId=? AND severity=?
> AND time>=? AND time<=? ORDER BY TIME
> 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)