cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7855) Genralize use of IN for compound partition keys
Date Thu, 29 Jan 2015 10:25:35 GMT

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

Benjamin Lerer commented on CASSANDRA-7855:
-------------------------------------------

I agree that it is related to the problem described because it is linked to the way we select
partition keys. Nevertheless it is not the same problem. 

Supporting queries like {{SELECT * FROM foo WHERE k1 IN (0, 1) AND k2 IN (1, 2)}} can be done
easily thanks to CASSANDRA-4762 and CASSANDRA-7981.

Supporting queries like {{SELECT * FROM foo WHERE (k1, k2) IN ( (0, 1) , (1, 2) )}} requires
that we add support for multi-column relations on partition keys. It can be done but should
probably be done in another ticket to keep the scope of the problems clear.

> Genralize use of IN for compound partition keys
> -----------------------------------------------
>
>                 Key: CASSANDRA-7855
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7855
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Sylvain Lebresne
>            Assignee: Benjamin Lerer
>            Priority: Minor
>              Labels: cql
>             Fix For: 3.0
>
>
> When you have a compount partition key, we currently only support to have a {{IN}} on
the last column of that partition key. So given:
> {noformat}
> CREATE TABLE foo (
>     k1 int,
>     k2 int,
>     v int,
>     PRIMARY KEY ((k1, k2))
> )
> {noformat}
> we allow
> {noformat}
> SELECT * FROM foo WHERE k1 = 0 AND k2 IN (1, 2)
> {noformat}
> but not
> {noformat}
> SELECT * FROM foo WHERE k1 IN (0, 1) AND k2 IN (1, 2)
> {noformat}
> There is no particular reason for us not supporting the later (to the best of my knowledge)
since it's reasonably straighforward, so we should fix it.
> I'll note that using {{IN}} on a partition key is not necessarily a better idea than
parallelizing queries server client side so this syntax, when introduced, should probably
be used sparingly, but given we do support IN on partition keys, I see no reason not to extend
it to compound PK properly.



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

Mime
View raw message