cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7017) allow per-partition LIMIT clause in cql
Date Thu, 02 Oct 2014 13:55:35 GMT

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

Aleksey Yeschenko commented on CASSANDRA-7017:
----------------------------------------------

How abut a more verbose {noformat}PER PARTITION LIMIT{noformat}?

PARTITION LIMIT is somewhat confusing - I see it meaning 'the limit to the number of partitions
returned'. The more explicit PER PARTITION LIMIT is a bit more painful to type/read, but at
least it's clear (and this use case is a somewhat rare one, so it really doesn't hurt much
to be more verbose here).

> allow per-partition LIMIT clause in cql
> ---------------------------------------
>
>                 Key: CASSANDRA-7017
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7017
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jonathan Halliday
>            Assignee: Dan Burkert
>              Labels: cql
>             Fix For: 3.0
>
>         Attachments: 0001-CASSANDRA-7017.patch
>
>
> somewhat related to static columns (#6561) and slicing (#4851), it is desirable to apply
a LIMIT on a per-partition rather than per-query basis, such as to retrieve the top (most
recent, etc) N clustered values for each partition key, e.g.
> -- for each league, keep a ranked list of users
> create table scores (league text, score int, player text, primary key(league, score,
player) );
> -- get the top 3 teams in each league:
> select * from scores staticlimit 3;
> this currently requires issuing one query per partition key, which is tedious if all
the key partition key values are known and impossible if they aren't.



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

Mime
View raw message