Comments (5)
Ahh, OK, I see. There are CREATE INDEX ON test.test (col)
and CREATE INDEX ON test.test (val)
. IIUC, secondary indexes are internally implemented as materialized views (@nyh please correct me if I'm wrong), and client-side describe currently prints the MVs in addition to the secondary indexes (test.test_col_idx_index
and test.test_val_idx_index
respectively correspond to the aforementioned indexes).
I think this is a correct change in behavior. We only want to emit a single CREATE INDEX statement as it already takes care of creating the underlying materialized view. The CREATE MATERIALIZED VIEW is unneeded and would only cause problems if one tries to restore schema from DESCRIBE SCHEMA output.
In my opinion, it's a non-issue. I'll go ahead and close but @sylwiaszunejko, @nyh, @Jadw1 - feel free to reopen if I'm wrong about the conclusion here.
from scylladb.
Before DESCRIBE this queries are executed:
CREATE KEYSPACE test WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}; CREATE TABLE test.users ( userid text PRIMARY KEY, firstname text, lastname text, age int); CREATE INDEX myindex ON test.users (age); CREATE TABLE test.test (id int, col int, val text, PRIMARY KEY(id, col)); CREATE INDEX ON test.test (col); CREATE INDEX ON test.test (val)
@sylwiaszunejko, are you sure these are the only CREATE statements used in the test? Creating materialized views is done via CREATE MATERIALIZED VIEW statements and I can't see any such statements here.
from scylladb.
@piodul Yes, I am sure, I am talking for example about this dtest: https://github.com/scylladb/scylla-dtest/blob/next/cqlsh_tests/cqlsh_tests.py#L617 in this line https://github.com/scylladb/scylla-dtest/blob/next/cqlsh_tests/cqlsh_tests.py#L639 expected output has MV outputs: https://github.com/scylladb/scylla-dtest/blob/next/cqlsh_tests/cqlsh_tests.py#L826.
I also tested it locally by building scylla master, starting one node and doing these commands through cqlsh, there was no CREATE MATERIALIZED VIEW statements, but in DESCRIBE there were MV outputs.
from scylladb.
Before DESCRIBE this queries are executed:
CREATE KEYSPACE test WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}; CREATE TABLE test.users ( userid text PRIMARY KEY, firstname text, lastname text, age int); CREATE INDEX myindex ON test.users (age); CREATE TABLE test.test (id int, col int, val text, PRIMARY KEY(id, col)); CREATE INDEX ON test.test (col); CREATE INDEX ON test.test (val)@sylwiaszunejko, are you sure these are the only CREATE statements used in the test? Creating materialized views is done via CREATE MATERIALIZED VIEW statements and I can't see any such statements here.
+1
I've quickly tried it locally (my cqlsh is using server-side desc):
cqlsh> create keyspace ks1 with REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};
cqlsh> use ks1;
cqlsh:ks1> create table t (a int, b int, c int, primary key(a,b));
cqlsh:ks1> create materialized view mv as select a, b from t where b is not null primary key (a, b);
cqlsh:ks1> desc keyspace ks1;
CREATE KEYSPACE ks1 WITH replication = {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
CREATE TABLE ks1.t (
a int,
b int,
c int,
PRIMARY KEY (a, b)
) WITH CLUSTERING ORDER BY (b ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND speculative_retry = '99.0PERCENTILE'
AND paxos_grace_seconds = 864000
AND tombstone_gc = {'mode': 'timeout', 'propagation_delay_in_seconds': '3600'};
CREATE MATERIALIZED VIEW ks1.mv AS
SELECT a, b
FROM ks1.t
WHERE b IS NOT null
PRIMARY KEY (a, b)
WITH CLUSTERING ORDER BY (b ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND speculative_retry = '99.0PERCENTILE'
AND paxos_grace_seconds = 864000
AND tombstone_gc = {'mode': 'timeout', 'propagation_delay_in_seconds': '3600'};
from scylladb.
@Jadw1
I am talking about the situation where there is no create materialized view statement done before running describe. And in your test you used one, so I am not sure how it is relevant,
from scylladb.
Related Issues (20)
- Abnormal data volume in the commitlog directory HOT 1
- chunked_vector::reserve_partial does not work as documented if size > max_chunk_capacity()
- View update generation times out during index building HOT 1
- [x86_64, debug] auth_cluster/test_auth_v2_migration failed with InvalidRequest HOT 3
- [dtest-release, 6.0] alternator_tests.TesterAlternator.test_alternator_enforce_authorization failed with `StopIteration` HOT 11
- Include static service levels in service levels listing HOT 1
- docs: Issue on page Create a ScyllaDB Cluster - Multi Data Centers (DC)
- docs: Issue on page Replace a Dead Node in a ScyllaDB Cluster
- cql: fix LIMIT clause (epic)
- CDC with tablets: design
- Performance isolation of hints receiving: design
- Incorrect output of describe in full index on frozen collections HOT 1
- document "keyspace" and "table" arguments for "nodetool ring"
- FileNotFoundError: [Errno 2] No such file or directory: 'thrift' HOT 1
- Auth: optimize load on roles table during permission cache population
- RESTful API /storage_service/quiesce_topology may not wait for tablets to be rebalanced shortly after topology change
- tasks: abort method hits use after free
- [aarch64, debug] topology_experimental_raft/test_alternator failed with AssertionError
- How do you pronounce CQL? HOT 1
- Writing stopped on SCyllaDB node with unconfigured table error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scylladb.