Virtual keyspaces and tables
Virtual keyspaces and tables expose internal server data — such as configuration settings and metrics — as queryable tables.
These virtual tables are not associated with physical files on disk, have no memtables or SSTables.
Use CQL SELECT statements to retrieve this data without needing external monitoring tools or Java Management Extensions (JMX).
The system_virtual_schema keyspace
The system_virtual_schema keyspace exposes metadata virtual keyspace and table.
The CQL shell DESCRIBE KEYSPACE and DESCRIBE TABLE commands also .
Virtual keyspaces and tables are managed internally by the database. You cannot create, alter, or drop them using DDL commands.
| Column name | CQL type | Column type |
|---|---|---|
keyspace_name |
text |
partition key |
| Column name | CQL type | Column type |
|---|---|---|
keyspace_name |
text |
partition key |
table_name |
text |
clustering key |
comment |
text |
regular |
| Column Name | CQL Type | Column type |
|---|---|---|
keyspace_name |
text |
partition key |
table_name |
text |
clustering key |
column_name |
text |
clustering key |
clustering_order |
text |
regular |
column_name_bytes |
blob |
regular |
position |
int |
regular |
type |
text |
regular |
The system_views keyspace
The system_views keyspace provides a CQL interface to runtime data about the local node.
You can query its virtual tables to inspect caches, connected clients, SSTable metadata, node and peer status, pending hints, and configuration settings.
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
clustering key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
|
|
primary key |
|
|
regular |
|
|
regular |
| Column name | CQL type | Column type |
|---|---|---|
keyspace_name |
text |
partition key |
table_name |
text |
clustering key |
task_id |
uuid |
clustering key |
kind |
text |
regular |
progress |
bigint |
regular |
total |
bigint |
regular |
unit |
text |
regular |
|
The remaining amount of work can be computer using |
Virtual tables and CQL shell
Virtual tables are exposed as local tables, so CQL shell will display data for the currently connected host.
To displace schema for virtual tables, use DESCRIBE FULL SCHEMA to return schema for both the real keyspaces and the virtual ones.
|
Users are not allowed to create virtual keyspaces or virtual tables. |
To see the schema for the virtual table sstable_tasks, use:
DESCRIBE TABLE system_views.sstable_tasks;
For example:
/*
Warning: Table system_views.sstable_tasks is a virtual table and cannot be re-created with CQL.
Structure, for reference:
VIRTUAL TABLE system_views.sstable_tasks (
keyspace_name text,
table_name text,
task_id uuid,
kind text,
progress bigint,
total bigint,
unit text,
PRIMARY KEY (keyspace_name, table_name, task_id)
) WITH CLUSTERING ORDER BY (table_name ASC, task_id ASC)
AND comment = 'current sstable tasks';
*/
To discover how much time is remaining for SSTable tasks, use the following query:
SELECT total - progress AS remaining FROM system_views.sstable_tasks;
remaining
-----------
(0 rows)