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

Aleksey Yeschenko commented on CASSANDRA-11144:
-----------------------------------------------

Please read the discussion in CASSANDRA-9921. Starting with [this 
comment|https://issues.apache.org/jira/browse/CASSANDRA-9921?focusedCommentId=14802737&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14802737]
 and down.

> 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
>
> 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
(v6.3.4#6332)

Reply via email to