cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shuler (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-7630) compound secondary index on primary key fields
Date Tue, 29 Jul 2014 15:57:38 GMT

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

Michael Shuler updated CASSANDRA-7630:
--------------------------------------

    Assignee: Aleksey Yeschenko

> compound secondary index on primary key fields
> ----------------------------------------------
>
>                 Key: CASSANDRA-7630
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7630
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Carlo Bertuccini
>            Assignee: Aleksey Yeschenko
>              Labels: compositeColumns, secondaryIndex, secondary_index
>
> Hi all,
> I was wondering if a secondary index could be composite by more columns which are parts
of the primary key.
> Example 
> {code}
> CREATE TABLE users (
>   firstname text,
>   lastname text,
>   email text,
>   age int,
>   city text,
>   state text,
>   PRIMARY KEY ((firstname), email, lastname)
> )
> {code}
> This index should now be possible
> {code}
> CREATE INDEX surname_by_city on (city, lastname);
> {code}
> Since we surely know that lastname is always populated.
> Now the challenge is (and in my mind looks possible!-) to perform such queries:
> {code}
> select * from users where city = 'seattle';
> select * from users where city = 'seattle' and lastname = 'kirkland';
> select * from users where firstname='john' and city = 'seattle';
> select * from users where firstname='john' and city = 'seattle' and lastname = 'kirkland';
> {code}
> If this possibility has already been evaluated and discarded/being developed I ask sorry
but I couldn't find anywhere.
> Regards,
> Carlo



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message