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

Shahar Frank commented on CASSANDRA-11144:
------------------------------------------

As two years passed since this discussion... is it possible that the 'might 
limit future changes' reason has gotten obsolete by now and this feature can be 
introduced now? Would help tremendously!

> Allow indexes on materialized views
> -----------------------------------
>
>                 Key: CASSANDRA-11144
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11144
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jon Haddad
>            Priority: Major
>
> Users should be able to create indexes on fields in materialized views.  
> Here's an example of a user database.  It would be good to be able to 
> efficiently query the database for users born on a particular day with a 
> particular name (or name starting with a certain letter).  I've used SASI 
> indexes since they support LIKE prefixes.
> {code}
> CREATE TABLE users (
>     id uuid PRIMARY KEY,
>     first_name text,
>     last_name text,
>     birthday date
> );
> CREATE MATERIALIZED VIEW users_by_date AS
>     SELECT birthday, id, first_name, last_name
>     FROM users
>     WHERE birthday IS NOT NULL
>     PRIMARY KEY (birthday, id)
>     WITH CLUSTERING ORDER BY (id ASC);
> CREATE CUSTOM INDEX on users_by_date(first_name) 
>     USING 'org.apache.cassandra.index.sasi.SASIIndex';
>     {code}
> And I get back
> {code}
> InvalidRequest: code=2200 [Invalid query] message="Secondary indexes are not 
> supported on materialized views"
> {code}
> I think the index is valid, since it'll allow me to take advantage of 
> querying a single partition, and the index allows me to find arbitrary rows 
> within that partition.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to