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

Jonathan Ellis commented on CASSANDRA-6477:
-------------------------------------------

I'm warming up to the idea of calling it MV but only IF we're committed to 
fleshing it out to match SELECT.

To start that can match our current envisioned functionality:

CREATE MATERIALIZED VIEW users_by_age AS
SELECT age, user_id, x, y, z FROM users
PRIMARY KEY (age, user_id)

but next we need to add support for WHERE and UDF:

CREATE MATERIALIZED VIEW users_by_age AS
SELECT age, user_id, substring(phone_number, 3) AS area_code, y, z FROM users
WHERE area_code in (512, 513, 514)
PRIMARY KEY (age, user_id)

Building the view should take advantage of local indexes where applicable.

Ideally we would support aggregation in MV as well.  Not sure if that is 
feasible.

> Global indexes
> --------------
>
>                 Key: CASSANDRA-6477
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6477
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>            Assignee: Carl Yeksigian
>              Labels: cql
>             Fix For: 3.0
>
>
> Local indexes are suitable for low-cardinality data, where spreading the 
> index across the cluster is a Good Thing.  However, for high-cardinality 
> data, local indexes require querying most nodes in the cluster even if only a 
> handful of rows is returned.



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

Reply via email to