Database Reference
In-Depth Information
DESCRIBE
The
DESCRIBE
command is used to get details of container objects. You can use
DESC
in
place of
DESCRIBE
. So, one can describe a keyspace, table, or cluster. There are five vari-
ants of this command:
# Describe the whole cluster
DESCRIBE CLUSTER
# Display the CQL command to regenerate all the keyspaces in
the cluster
DESCRIBE SCHEMA
# List all the keyspaces names
DESCRIBE KEYSPACES
# List the CQL statement that can be used to recreate the
keyspace
DESCRIBE KEYSPACE <keyspace_name>
# Show tables names in the current keyspace
# Show all the tables across all the keyspaces if not using
any keyspace
DESCRIBE TABLES
# Print CQL to create a table
DESCRIBE TABLE <table_name>
TRACING
The
TRACING
command is a convenient tool to view the steps that your queries go
through and possibly use it to optimize the query. It displays how much time is spent on
what step at which node.
Use
TRACING ON
to turn tracing on, on every subsequent query. To turn
TRACING
off,
use
TRACING OFF
.
CONSISTENCY
The
CONSISTENCY
command can be used to view or set current consistency level.
# To view the consistency level
CONSISTENCY
# To set the consistency level for all the following queries