cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Thompson (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-8509) Range queries/ORDER BY should be possible with a secondary index for a single row
Date Thu, 18 Dec 2014 14:06:13 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-8509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Philip Thompson 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:
{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.

  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 timestamp,
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.


> 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)

Mime
View raw message