https://issues.apache.org/jira/browse/CASSANDRA-13857 for anyone
interested. Appreciate a sanity check on the logic if anyone gets the
chance.
On 8 September 2017 at 02:14, kurt greaves wrote:
> Looks like there are a couple of oversights w.r.t what we allow in the
> view statement here. I'm cre
Looks like there are a couple of oversights w.r.t what we allow in the view
statement here. I'm creating a JIRA and will link it here shortly as soon
as I've fleshed out all the details.
He wants the same primary key, but just wants to filter on site_id = 1 at
view creation time. seems like a valid and reasonable use case to me, but I
would say this case was overlooked when setting the PK restrictions.
;>>>> And just in case, I tried secondary indices on site_id. For such use
>>>>> they improve nothing.
>>>>>
>>>>>
>>>>> But things are changing and we realized that we want to get rid of
>>>>> clustering key,
> they improve nothing.
>>>>
>>>>
>>>> But things are changing and we realized that we want to get rid of
>>>> clustering key, n.
>>>>
>>>> DROP MATERIALIZED VIEW users_1;
>>>> DROP TABLE users;
>>>&g
ing.
>>>
>>>
>>> But things are changing and we realized that we want to get rid of
>>> clustering key, n.
>>>
>>> DROP MATERIALIZED VIEW users_1;
>>> DROP TABLE users;
>>>
>>> CREATE TABLE users (
>>> site_id i
; user_id text,
>> data set,
>> PRIMARY KEY ((site_id, user_id)));
>>
>> CREATE MATERIALIZED VIEW users_1 AS
>> SELECT site_id, user_id, data
>> FROM users
>> WHERE site_id = 1 AND user_id IS NOT NULL
>> PRIMARY KEY ((site_id, user_id));
>>
>>
PRIMARY KEY ((site_id, user_id)));
>>
>> CREATE MATERIALIZED VIEW users_1 AS
>> SELECT site_id, user_id, data
>> FROM users
>> WHERE site_id = 1 AND user_id IS NOT NULL
>> PRIMARY KEY ((site_id, user_id));
>>
>> And here I get the error I listed in t
);
>
> CREATE MATERIALIZED VIEW users_1 AS
> SELECT site_id, user_id, data
> FROM users
> WHERE site_id = 1 AND user_id IS NOT NULL
> PRIMARY KEY ((site_id, user_id));
>
> And here I get the error I listed in the subject.
> InvalidRequest: Error from server: code=2
200 [Invalid query] message="No
columns are defined for Materialized View other than primary key"
But why? I still expect scans to be faster with MV. It appears to be
possible to create a dummy column and using as a clustering key. That's
ugly.
--
Best Regards,
*Alexander Kotel
10 matches
Mail list logo