cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Mior <mm...@uwaterloo.ca>
Subject Re: Question about materialized view
Date Mon, 26 Jun 2017 13:50:37 GMT
This is handled by updateAffectsView in org.apache.cassandra.db.view.View.
It will scan over each row to be updated in the base table and see that the
column is not included in the view definition and skip the update.

--
Michael Mior
mmior@apache.org

2017-06-21 2:41 GMT-04:00 web master <socketman2016@gmail.com>:

> Assume this schema
>
> CREATE TABLE t(
>         a int,
>         b int,
>         c int,
>         d int,
>         e text,
>         f date,
>         g int,
>         PRIMARY KEY (a,b)
> )
>
>
> I we create following mv
>
> CREATE MATERIALIZED VIEW t_mv as
>         select a,b,c,d from t where c is not null and d is not null
>          PRIMARY KEY (c,d,a,b);
>
>
> What happens if we run this query
>
> UPDATE t SET g=1 WHERE a=10 AND b = 20
>
>
> As you can see "g" is excluded in "t_mv" , I want to know what cassandra
> doing internaly?
>
> Is there any overhead for t_mv , or cassandra smartly detect there is no
> changes for t_mv and no-operation
>
>
> for example If we have 10 materialized view like above-mentioned , is
> Update that excluded in mv impact performance? or the performance in equal
> to when there is no mv
>

Mime
View raw message