You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2013/12/19 16:16:07 UTC

[jira] [Updated] (CASSANDRA-6383) Secondary indexing of map keys

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

Sylvain Lebresne updated CASSANDRA-6383:
----------------------------------------

    Attachment: 6383.txt

Turns out the changes to do to the 2ndary index API to support 2 indexes on the same column are not all that trivial. We'd need to change ColumnDefinition so we can have multiple index infos, modify all places that uses that and basically rewrite a good part of SecondaryIndexManager (and possibly some other bits).  It's probably worth doing all this refactoring at some point, but is probably something that deserve it's own ticket.

In the meantime, I suggest for this issue to add support for index on keys but to not allow creating an index on both the keys and values of the same map. I'm sure there is plenty of cases where this is good enough.

Attaching patch that does that.


> Secondary indexing of map keys
> ------------------------------
>
>                 Key: CASSANDRA-6383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6383
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1
>
>         Attachments: 6383.txt
>
>
> CASSANDRA-4511 started adding secondary indexing for collections, but didn't wired map key indexing because this requires generalizing a bit the 2ndary index API to support 2 indexes on the same column. And since that's not entirely related to the initial problem of CASSANDRA-4511, let's tackle this last part here.
> I'll note that one other is the syntax. For selection, I propose
> {noformat}
> SELECT * FROM foo WHERE myMap CONTAINS KEY 'bar';
> {noformat}
> (but that assumes we use CONTAINS in CASSANDRA-4511, if we use IN, we'll need something else)
> For declaring indexes I'm less inspired. We could have something like
> {noformat}
> CREATE INDEX ON foo(myMap KEYS)
> {noformat}
> but maybe someone has a better idea?



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)