| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| <title>Virtual Tables | Apache Cassandra Documentation</title> |
| <link rel="stylesheet" href="../../../../assets/css/site.css"> |
| <link rel="schema.dcterms" href="https://purl.org/dc/terms/"> |
| <meta name="dcterms.subject" content="Cassandra"> |
| <meta name="dcterms.identifier" content="4.1"> |
| <meta name="generator" content="Antora 2.3.4"> |
| <link rel="icon" href="../../../../assets/img/favicon.ico" type="image/x-icon"> |
| <script> |
| const script = document.createElement("script"); |
| const domain = window.location.hostname; |
| script.type = "text/javascript"; |
| script.src = "https://plausible.cassandra.apache.org/js/plausible.js"; |
| script.setAttribute("data-domain",domain); |
| script.setAttribute("defer",'true'); |
| script.setAttribute("async",'true'); |
| document.getElementsByTagName("head")[0].appendChild(script); |
| </script> </head> |
| <body class="docs-wrapper article"> |
| <div class="container mx-auto relative"> |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> |
| <meta property="og:type" content="website" /> |
| <meta property="og:url" content="/" /> |
| <meta property="og:site_name" content="Apache Cassandra" /> |
| |
| <header id="top-nav"> |
| <div class="inner relative"> |
| <div class="header-social-icons text-right"> |
| <a href="https://twitter.com/cassandra?lang=en" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a> |
| <a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a> |
| <a href="https://www.youtube.com/c/PlanetCassandra" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a> |
| </div> |
| <div class="cf"> |
| <div class="logo left"><a href="/"><img src="../../../../assets/img/logo-white-r.png" alt="Cassandra Logo"></a></div> |
| <div class="mobile-nav-icon right"> |
| <img class="toggle-icon" src="../../../../assets/img/hamburger-nav.svg"> |
| </div> |
| <ul class="main-nav nav-links right flex flex-vert-center flex-space-between"> |
| <li> |
| <a class="nav-link hide-mobile">Get Started</a> |
| <ul class="sub-menu bg-white"> |
| <li class="pa-micro"> |
| <a href="/_/cassandra-basics.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-basics.png" alt="cassandra basics icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Cassandra Basics |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro"> |
| <a href="/_/quickstart.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-rocket.png" alt="cassandra basics icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Quickstart |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro"> |
| <a href="/_/ecosystem.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-ecosystem.png" alt="cassandra basics icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Ecosystem |
| </div> |
| </a> |
| </li> |
| </ul> |
| </li> |
| <li><a class="nav-link" href="/doc/latest/">Documentation</a></li> |
| <li> |
| <a class="nav-link" href="/_/community.html">Community</a> |
| <ul class="sub-menu bg-white"> |
| <li class="pa-micro"> |
| <a href="/_/community.html#code-of-conduct"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-welcome.png" alt="welcome icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Welcome |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/community.html#discussions"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-discussions.png" alt="discussions icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Discussions |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/community.html#project-governance"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-governance.png" alt="Governance icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Governance |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/community.html#how-to-contribute"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-contribute.png" alt="Contribute icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Contribute |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/community.html#meet-the-community"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-community.png" alt="Meet the Community icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Meet the Community |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/cassandra-catalyst-program.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-catalyst.png" alt="Catalyst icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Catalyst Program |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro hide-mobile"> |
| <a href="/_/events.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-events.png" alt="Events icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Events |
| </div> |
| </a> |
| </li> |
| </ul> |
| </li> |
| <li> |
| <a class="nav-link hide-mobile">Learn</a> |
| <ul class="sub-menu bg-white"> |
| <li class="pa-micro"> |
| <a href="/_/Apache-Cassandra-5.0-Moving-Toward-an-AI-Driven-Future.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-basics.png" alt="Basics icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Cassandra 5.0 |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro"> |
| <a href="/_/case-studies.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-case-study.png" alt="Case Studies icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Case Studies |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro"> |
| <a href="/_/resources.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-resources.png" alt="Resources icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Resources |
| </div> |
| </a> |
| </li> |
| <li class="pa-micro"> |
| <a href="/_/blog.html"> |
| <div class="sub-nav-icon"> |
| <img src="../../../../assets/img/sub-menu-blog.png" alt="Blog icon"> |
| </div> |
| <div class="sub-nav-text teal py-small"> |
| Blog |
| </div> |
| </a> |
| </li> |
| </ul> |
| </li> |
| <li><a class="nav-link btn btn--filled" href="/_/download.html">Download Now</a></li> |
| </ul> |
| </div> |
| </div> |
| </header> |
| |
| <div class="hero hero--home grad"> |
| <div class="eye"></div> |
| <div id="docs-content" class="text-center flex flex-center flex-column relative z2 ma-xlarge"> |
| <h2>Cassandra Documentation</h2> |
| </div> |
| </div> |
| <div class="body px-medium py-medium container"> |
| <div class="docs-nav-bar flex flex-space-between mb-medium"> |
| <div id="mobile-docs-nav-burger" class="hidden"> |
| <svg viewBox="0 0 24 24" width="36" height="36" stroke="#1c81a0" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg> |
| </div> |
| <div class="docs-nav-item relative"> |
| <input id="search-input" type="text" placeholder="Search docs"> |
| </div> |
| <div class="versions-wrapper"> |
| <h4>Version:</h4> |
| <div class="nav-panel-explore" data-panel="explore"> |
| |
| <div id="version-toggle" class="context"> |
| <span class="version">4.1</span> |
| </div> |
| <ul id="versions-list" class="components"> |
| <li class="component"> |
| <ul class="versions"> |
| <li class="version is-latest"> |
| <a href="../../../../_/index.html">master</a> |
| </li> |
| </ul> |
| </li> |
| <li class="component is-current"> |
| <ul class="versions"> |
| <li class="version"> |
| <a href="../../../trunk/index.html">trunk</a> |
| </li> |
| <li class="version"> |
| <a href="../../../5.0/index.html">5.0</a> |
| </li> |
| <li class="version is-current is-latest"> |
| <a href="../../index.html">4.1</a> |
| </li> |
| <li class="version"> |
| <a href="../../../4.0/index.html">4.0</a> |
| </li> |
| <li class="version"> |
| <a href="../../../3.11/index.html">3.11</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> </div> |
| <div class="cf relative"> |
| <nav class="nav docs-nav full-800"> |
| <div class="nav-menu"> |
| <ul class="nav-list"> |
| <li class="nav-item is-active" data-depth="0"> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="1"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../../index.html">Main</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/glossary.html">Glossary</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/bugs.html">How to report bugs</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/contactus.html">Contact us</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item is-active" data-depth="0"> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="1"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <span class="nav-text">Cassandra</span> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../getting_started/index.html">Getting Started</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/installing.html">Installing Cassandra</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/configuring.html">Configuring Cassandra</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/querying.html">Inserting and querying</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/drivers.html">Client drivers</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/java11.html">Support for Java 11</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../getting_started/production.html">Production recommendations</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="index.html">What’s new</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../architecture/index.html">Architecture</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/overview.html">Overview</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/dynamo.html">Dynamo</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/storage_engine.html">Storage engine</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/guarantees.html">Guarantees</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/messaging.html">Improved internode messaging</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../architecture/streaming.html">Improved streaming</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../data_modeling/index.html">Data modeling</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/intro.html">Introduction</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_conceptual.html">Conceptual data modeling</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_rdbms.html">RDBMS design</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_queries.html">Defining application queries</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_logical.html">Logical data modeling</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_physical.html">Physical data modeling</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_refining.html">Evaluating and refining data models</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_schema.html">Defining database schema</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../data_modeling/data_modeling_tools.html">Cassandra data modeling tools</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../cql/index.html">Cassandra Query Language (CQL)</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/definitions.html">Definitions</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/types.html">Data types</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/ddl.html">Data definition (DDL)</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/dml.html">Data manipulation (DML)</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/operators.html">Operators</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/indexes.html">Secondary indexes</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/mvs.html">Materialized views</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/functions.html">Functions</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/json.html">JSON</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/security.html">Security</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/triggers.html">Triggers</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/appendices.html">Appendices</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/changes.html">Changes</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/SASI.html">SASI</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../cql/cql_singlefile.html">Single file of CQL information</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../configuration/index.html">Configuration</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_yaml_file.html">cassandra.yaml</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_rackdc_file.html">cassandra-rackdc.properties</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_env_sh_file.html">cassandra-env.sh</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_topo_file.html">cassandra-topologies.properties</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_cl_archive_file.html">commitlog-archiving.properties</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_logback_xml_file.html">logback.xml</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/cass_jvm_options_file.html">jvm-* files</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../configuration/configuration.html">Liberating cassandra.yaml Parameters' Names from Their Units</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../operating/index.html">Operating</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="#operating/snitch.adoc">Snitches</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/topo_changes.html">Topology changes</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/repair.html">Repair</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/read_repair.html">Read repair</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/hints.html">Hints</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/bloom_filters.html">Bloom filters</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/compression.html">Compression</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/cdc.html">Change Data Capture (CDC)</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/backups.html">Backups</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/bulk_loading.html">Bulk loading</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/metrics.html">Metrics</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/security.html">Security</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/hardware.html">Hardware</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/compaction/index.html">Compaction</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/virtualtables.html">Virtual tables</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/auditlogging.html">Audit logging</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/audit_logging.html">Audit logging 2</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/fqllogging.html">Full query logging</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../operating/transientreplication.html">Transient replication</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../tools/index.html">Tools</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../tools/cqlsh.html">cqlsh: the CQL shell</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../tools/nodetool/nodetool.html">nodetool</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../tools/sstable/index.html">SSTable tools</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../tools/cassandra_stress.html">cassandra-stress</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../troubleshooting/index.html">Troubleshooting</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../troubleshooting/finding_nodes.html">Finding misbehaving nodes</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../troubleshooting/reading_logs.html">Reading Cassandra logs</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../troubleshooting/use_nodetool.html">Using nodetool</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../troubleshooting/use_tools.html">Using external tools to deep-dive</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <button class="nav-toggle"></button> |
| <a class="nav-link" href="../../../../_/development/index.html">Development</a> |
| </span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/gettingstarted.html">Getting started</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/ide.html">Building and IDE integration</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/testing.html">Testing</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/patches.html">Contributing code changes</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/code_style.html">Code style</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/how_to_review.html">Review checklist</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/how_to_commit.html">How to commit</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/documentation.html">Working on documentation</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/ci.html">Jenkins CI environment</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/dependencies.html">Dependency management</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../../../../_/development/release_process.html">Release process</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../faq/index.html">FAQ</a> |
| </span> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <span class="nav-line"> |
| <a class="nav-link" href="../plugins/index.html">Plug-ins</a> |
| </span> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </nav> |
| <aside class="toc sidebar"> |
| <div class="toc-menu"></div> |
| </aside> |
| <main class="article default-main full-800" data-ceiling="topbar"> |
| <div class="article-header"> |
| <nav class="crumbs" aria-label="breadcrumbs"> |
| <ul> |
| <li class="crumb"><a href="../../index.html">Cassandra</a></li> |
| <li class="crumb"><a href="virtualtables.html">Virtual Tables</a></li> |
| </ul> |
| </nav> |
| <div class="tools" role="navigation"> |
| <ul> |
| <li class="tool edit"><a href="https://github.com/apache/cassandra/edit/cassandra-4.1/doc/modules/cassandra/pages/new/virtualtables.adoc" title="Edit Page" target="_blank" rel="noopener">Edit</a></li> |
| </ul> |
| </div> |
| </div> |
| <article class="doc"> |
| <h1 class="page">Virtual Tables</h1> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Apache Cassandra 4.0 implements virtual tables (<a href="https://issues.apache.org/jira/browse/CASSANDRA-7622">CASSANDRA-7622</a>). |
| Virtual tables are tables backed by an API instead of data explicitly managed and stored as SSTables. |
| Apache Cassandra 4.0 implements a virtual keyspace interface for virtual tables. |
| Virtual tables are specific to each node.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Some of the features of virtual tables are the ability to:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>expose metrics through CQL</p> |
| </li> |
| <li> |
| <p>expose YAML configuration information</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Virtual keyspaces and tables are quite different from regular tables and keyspaces:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Virtual tables are created in special keyspaces and not just any keyspace.</p> |
| </li> |
| <li> |
| <p>Virtual tables are managed by Cassandra. Users cannot run DDL to create new virtual tables or DML to modify existing virtual tables.</p> |
| </li> |
| <li> |
| <p>Virtual tables are currently read-only, although that may change in a later version.</p> |
| </li> |
| <li> |
| <p>Virtual tables are local only, non-distributed, and thus not replicated.</p> |
| </li> |
| <li> |
| <p>Virtual tables have no associated SSTables.</p> |
| </li> |
| <li> |
| <p>Consistency level of the queries sent to virtual tables are ignored.</p> |
| </li> |
| <li> |
| <p>All existing virtual tables use <code>LocalPartitioner</code>. |
| Since a virtual table is not replicated the partitioner sorts in order of partition keys instead of by their hash.</p> |
| </li> |
| <li> |
| <p>Making advanced queries using <code>ALLOW FILTERING</code> and aggregation functions can be executed in virtual tables, even though in normal tables we dont recommend it.</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="virtual-keyspaces"><a class="anchor" href="#virtual-keyspaces"></a>Virtual Keyspaces</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Apache Cassandra 4.0 has added two new keyspaces for virtual tables:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><code>system_virtual_schema</code></p> |
| </li> |
| <li> |
| <p><code>system_views</code>.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>The <code>system_virtual_schema</code> keyspace has three tables: <code>keyspaces</code>, |
| <code>columns</code> and <code>tables</code> for the virtual keyspace, table, and column definitions, respectively. |
| These tables contain schema information for the virtual tables. |
| It is used by Cassandra internally and a user should not access it directly.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The <code>system_views</code> keyspace contains the actual virtual tables.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="virtual-table-limitations"><a class="anchor" href="#virtual-table-limitations"></a>Virtual Table Limitations</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Before disccusing virtual keyspaces and tables, note that virtual keyspaces and tables have some limitations. |
| These limitations are subject to change. |
| Virtual keyspaces cannot be altered or dropped. |
| In fact, no operations can be performed against virtual keyspaces.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Virtual tables cannot be created in virtual keyspaces. |
| Virtual tables cannot be altered, dropped, or truncated. |
| Secondary indexes, types, functions, aggregates, materialized views, and triggers cannot be created for virtual tables. |
| Expiring time-to-live (TTL) columns cannot be created. |
| Virtual tables do not support conditional updates or deletes. |
| Aggregates may be run in SELECT statements.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Conditional batch statements cannot include mutations for virtual tables, nor can a virtual table statement be included in a logged batch. |
| In fact, mutations for virtual and regular tables cannot occur in the same batch table.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="virtual-tables"><a class="anchor" href="#virtual-tables"></a>Virtual Tables</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Each of the virtual tables in the <code>system_views</code> virtual keyspace contain different information.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following table describes the virtual tables:</p> |
| </div> |
| <table class="tableblock frame-all grid-all" style="width: 98%;"> |
| <colgroup> |
| <col style="width: 27%;"> |
| <col style="width: 73%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top">Virtual Table</th> |
| <th class="tableblock halign-left valign-top">Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">caches</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Displays the general cache information including cache name, capacity_bytes, entry_count, hit_count, hit_ratio double, |
| recent_hit_rate_per_second, recent_request_rate_per_second, request_count, and size_bytes.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">clients</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Lists information about all connected clients.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">coordinator_read_latency</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for coordinator reads.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">coordinator_scan</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for coordinator scans.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">coordinator_write_latency</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for coordinator writes.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">cql_metrics</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Metrics specific to CQL prepared statement caching.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">disk_usage</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records disk usage including disk_space, keyspace_name, and table_name, sorted by system keyspaces.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">gossip_info</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Lists the gossip information for the cluster.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">internode_inbound</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Lists information about the inbound internode messaging.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">internode_outbound</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Information about the outbound internode messaging.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">local_read_latency</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for local reads.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">local_scan</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for local scans.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">local_write_latency</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, table_name, max, median, and per_second for local writes.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">max_partition_size</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">A table metric for maximum partition size.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">rows_per_read</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, tablek_name, max, and median for rows read.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">settings</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Displays configuration settings in cassandra.yaml.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">sstable_tasks</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Lists currently running tasks and progress on SSTables, for operations like compaction and upgrade.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">system_properties</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Displays environmental system properties set on the node.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">thread_pools</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Lists metrics for each thread pool.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">tombstones_per_read</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Records counts, keyspace_name, tablek_name, max, and median for tombstones.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="paragraph"> |
| <p>We shall discuss some of the virtual tables in more detail next.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="clients-virtual-table"><a class="anchor" href="#clients-virtual-table"></a>Clients Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>clients</code> virtual table lists all active connections (connected |
| clients) including their ip address, port, client_options, connection stage, driver |
| name, driver version, hostname, protocol version, request count, ssl |
| enabled, ssl protocol and user name:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> EXPAND ON ; |
| Now Expanded output is enabled |
| cqlsh> SELECT * FROM system_views.clients; |
| |
| @ Row 1 |
| ------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address | 127.0.0.1 |
| port | 50687 |
| client_options | {'CQL_VERSION': '3.4.6', 'DRIVER_NAME': 'DataStax Python Driver', 'DRIVER_VERSION': '3.25.0'} |
| connection_stage | ready |
| driver_name | DataStax Python Driver |
| driver_version | 3.25.0 |
| hostname | localhost |
| protocol_version | 5 |
| request_count | 16 |
| ssl_cipher_suite | null |
| ssl_enabled | False |
| ssl_protocol | null |
| username | anonymous |
| |
| @ Row 2 |
| ------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address | 127.0.0.1 |
| port | 50688 |
| client_options | {'CQL_VERSION': '3.4.6', 'DRIVER_NAME': 'DataStax Python Driver', 'DRIVER_VERSION': '3.25.0'} |
| connection_stage | ready |
| driver_name | DataStax Python Driver |
| driver_version | 3.25.0 |
| hostname | localhost |
| protocol_version | 5 |
| request_count | 4 |
| ssl_cipher_suite | null |
| ssl_enabled | False |
| ssl_protocol | null |
| username | anonymous |
| |
| @ Row 3 |
| ------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address | 127.0.0.1 |
| port | 50753 |
| client_options | {'APPLICATION_NAME': 'TestApp', 'APPLICATION_VERSION': '1.0.0', 'CLIENT_ID': '55b3efbd-c56b-469d-8cca-016b860b2f03', 'CQL_VERSION': '3.0.0', 'DRIVER_NAME': 'DataStax Java driver for Apache Cassandra(R)', 'DRIVER_VERSION': '4.13.0'} |
| connection_stage | ready |
| driver_name | DataStax Java driver for Apache Cassandra(R) |
| driver_version | 4.13.0 |
| hostname | localhost |
| protocol_version | 5 |
| request_count | 18 |
| ssl_cipher_suite | null |
| ssl_enabled | False |
| ssl_protocol | null |
| username | anonymous |
| |
| @ Row 4 |
| ------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address | 127.0.0.1 |
| port | 50755 |
| client_options | {'APPLICATION_NAME': 'TestApp', 'APPLICATION_VERSION': '1.0.0', 'CLIENT_ID': '55b3efbd-c56b-469d-8cca-016b860b2f03', 'CQL_VERSION': '3.0.0', 'DRIVER_NAME': 'DataStax Java driver for Apache Cassandra(R)', 'DRIVER_VERSION': '4.13.0'} |
| connection_stage | ready |
| driver_name | DataStax Java driver for Apache Cassandra(R) |
| driver_version | 4.13.0 |
| hostname | localhost |
| protocol_version | 5 |
| request_count | 7 |
| ssl_cipher_suite | null |
| ssl_enabled | False |
| ssl_protocol | null |
| username | anonymous |
| |
| (4 rows)</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Some examples of how <code>clients</code> can be used are:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>To find applications using old incompatible versions of drivers before |
| upgrading and with <code>nodetool enableoldprotocolversions</code> and |
| <code>nodetool disableoldprotocolversions</code> during upgrades.</p> |
| </li> |
| <li> |
| <p>To identify clients sending too many requests.</p> |
| </li> |
| <li> |
| <p>To find if SSL is enabled during the migration to and from ssl.</p> |
| </li> |
| <li> |
| <p>To identify all options the client is sending, e.g. APPLICATION_NAME and APPLICATION_VERSION</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>The virtual tables may be described with <code>DESCRIBE</code> statement. The DDL |
| listed however cannot be run to create a virtual table. As an example |
| describe the <code>system_views.clients</code> virtual table:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> DESCRIBE TABLE system_views.clients; |
| |
| /* |
| Warning: Table system_views.clients is a virtual table and cannot be recreated with CQL. |
| Structure, for reference: |
| VIRTUAL TABLE system_views.clients ( |
| address inet, |
| port int, |
| client_options frozen<map<text, text>>, |
| connection_stage text, |
| driver_name text, |
| driver_version text, |
| hostname text, |
| protocol_version int, |
| request_count bigint, |
| ssl_cipher_suite text, |
| ssl_enabled boolean, |
| ssl_protocol text, |
| username text, |
| PRIMARY KEY (address, port) |
| ) WITH CLUSTERING ORDER BY (port ASC) |
| AND comment = 'currently connected clients'; |
| */</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="caches-virtual-table"><a class="anchor" href="#caches-virtual-table"></a>Caches Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>caches</code> virtual table lists information about the caches. The four |
| caches presently created are chunks, counters, keys and rows. A query on |
| the <code>caches</code> virtual table returns the following details:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh:system_views> SELECT * FROM system_views.caches; |
| name | capacity_bytes | entry_count | hit_count | hit_ratio | recent_hit_rate_per_second | recent_request_rate_per_second | request_count | size_bytes |
| ---------+----------------+-------------+-----------+-----------+----------------------------+--------------------------------+---------------+------------ |
| chunks | 229638144 | 29 | 166 | 0.83 | 5 | 6 | 200 | 475136 |
| counters | 26214400 | 0 | 0 | NaN | 0 | 0 | 0 | 0 |
| keys | 52428800 | 14 | 124 | 0.873239 | 4 | 4 | 142 | 1248 |
| rows | 0 | 0 | 0 | NaN | 0 | 0 | 0 | 0 |
| |
| (4 rows)</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="cql-metrics-virtual-table"><a class="anchor" href="#cql-metrics-virtual-table"></a>CQL metrics Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>cql_metrics</code> virtual table lists metrics specific to CQL prepared statement caching. A query on <code>cql_metrics</code> virtual table lists below metrics.</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> select * from system_views.cql_metrics ; |
| |
| name | value |
| ------------------------------+------- |
| prepared_statements_count | 0 |
| prepared_statements_evicted | 0 |
| prepared_statements_executed | 0 |
| prepared_statements_ratio | 0 |
| regular_statements_executed | 17</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="settings-virtual-table"><a class="anchor" href="#settings-virtual-table"></a>Settings Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>settings</code> table is rather useful and lists all the current |
| configuration settings from the <code>cassandra.yaml</code>. The encryption options |
| are overridden to hide the sensitive truststore information or |
| passwords. The configuration settings however cannot be set using DML on |
| the virtual table presently: :</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh:system_views> SELECT * FROM system_views.settings; |
| |
| name | value |
| -------------------------------------+-------------------- |
| allocate_tokens_for_keyspace | null |
| audit_logging_options_enabled | false |
| auto_snapshot | true |
| automatic_sstable_upgrade | false |
| cluster_name | Test Cluster |
| transient_replication_enabled | false |
| hinted_handoff_enabled | true |
| hints_directory | /home/ec2-user/cassandra/data/hints |
| incremental_backups | false |
| initial_token | null |
| ... |
| ... |
| ... |
| rpc_address | localhost |
| ssl_storage_port | 7001 |
| start_native_transport | true |
| storage_port | 7000 |
| stream_entire_sstables | true |
| (224 rows)</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The <code>settings</code> table can be really useful if yaml file has been changed |
| since startup and dont know running configuration, or to find if they |
| have been modified via jmx/nodetool or virtual tables.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="thread-pools-virtual-table"><a class="anchor" href="#thread-pools-virtual-table"></a>Thread Pools Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>thread_pools</code> table lists information about all thread pools. |
| Thread pool information includes active tasks, active tasks limit, |
| blocked tasks, blocked tasks all time, completed tasks, and pending |
| tasks. A query on the <code>thread_pools</code> returns following details:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh:system_views> select * from system_views.thread_pools; |
| |
| name | active_tasks | active_tasks_limit | blocked_tasks | blocked_tasks_all_time | completed_tasks | pending_tasks |
| ------------------------------+--------------+--------------------+---------------+------------------------+-----------------+--------------- |
| AntiEntropyStage | 0 | 1 | 0 | 0 | 0 | 0 |
| CacheCleanupExecutor | 0 | 1 | 0 | 0 | 0 | 0 |
| CompactionExecutor | 0 | 2 | 0 | 0 | 881 | 0 |
| CounterMutationStage | 0 | 32 | 0 | 0 | 0 | 0 |
| GossipStage | 0 | 1 | 0 | 0 | 0 | 0 |
| HintsDispatcher | 0 | 2 | 0 | 0 | 0 | 0 |
| InternalResponseStage | 0 | 2 | 0 | 0 | 0 | 0 |
| MemtableFlushWriter | 0 | 2 | 0 | 0 | 1 | 0 |
| MemtablePostFlush | 0 | 1 | 0 | 0 | 2 | 0 |
| MemtableReclaimMemory | 0 | 1 | 0 | 0 | 1 | 0 |
| MigrationStage | 0 | 1 | 0 | 0 | 0 | 0 |
| MiscStage | 0 | 1 | 0 | 0 | 0 | 0 |
| MutationStage | 0 | 32 | 0 | 0 | 0 | 0 |
| Native-Transport-Requests | 1 | 128 | 0 | 0 | 130 | 0 |
| PendingRangeCalculator | 0 | 1 | 0 | 0 | 1 | 0 |
| PerDiskMemtableFlushWriter_0 | 0 | 2 | 0 | 0 | 1 | 0 |
| ReadStage | 0 | 32 | 0 | 0 | 13 | 0 |
| Repair-Task | 0 | 2147483647 | 0 | 0 | 0 | 0 |
| RequestResponseStage | 0 | 2 | 0 | 0 | 0 | 0 |
| Sampler | 0 | 1 | 0 | 0 | 0 | 0 |
| SecondaryIndexManagement | 0 | 1 | 0 | 0 | 0 | 0 |
| ValidationExecutor | 0 | 2147483647 | 0 | 0 | 0 | 0 |
| ViewBuildExecutor | 0 | 1 | 0 | 0 | 0 | 0 |
| ViewMutationStage | 0 | 32 | 0 | 0 | 0 | 0</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>(24 rows)</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="internode-inbound-messaging-virtual-table"><a class="anchor" href="#internode-inbound-messaging-virtual-table"></a>Internode Inbound Messaging Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>internode_inbound</code> virtual table is for the internode inbound |
| messaging. Initially no internode inbound messaging may get listed. In |
| addition to the address, port, datacenter and rack information includes |
| corrupt frames recovered, corrupt frames unrecovered, error bytes, error |
| count, expired bytes, expired count, processed bytes, processed count, |
| received bytes, received count, scheduled bytes, scheduled count, |
| throttled count, throttled nanos, using bytes, using reserve bytes. A |
| query on the <code>internode_inbound</code> returns following details:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh:system_views> SELECT * FROM system_views.internode_inbound; |
| address | port | dc | rack | corrupt_frames_recovered | corrupt_frames_unrecovered | |
| error_bytes | error_count | expired_bytes | expired_count | processed_bytes | |
| processed_count | received_bytes | received_count | scheduled_bytes | scheduled_count | throttled_count | throttled_nanos | using_bytes | using_reserve_bytes |
| ---------+------+----+------+--------------------------+----------------------------+- |
| ---------- |
| (0 rows)</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="sstables-tasks-virtual-table"><a class="anchor" href="#sstables-tasks-virtual-table"></a>SSTables Tasks Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>sstable_tasks</code> could be used to get information about running |
| tasks. It lists following columns:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh:system_views> SELECT * FROM sstable_tasks; |
| keyspace_name | table_name | task_id | kind | progress | total | unit |
| ---------------+------------+--------------------------------------+------------+----------+----------+------- |
| basic | wide2 | c3909740-cdf7-11e9-a8ed-0f03de2d9ae1 | compaction | 60418761 | 70882110 | bytes |
| basic | wide2 | c7556770-cdf7-11e9-a8ed-0f03de2d9ae1 | compaction | 2995623 | 40314679 | bytes</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>As another example, to find how much time is remaining for SSTable |
| tasks, use the following query:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>SELECT total - progress AS remaining |
| FROM system_views.sstable_tasks;</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="gossip-information-virtual-table"><a class="anchor" href="#gossip-information-virtual-table"></a>Gossip Information Virtual Table</h3> |
| <div class="paragraph"> |
| <p>The <code>gossip_info</code> virtual table lists the Gossip information for the cluster. An example query is as follows:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> select address, port, generation, heartbeat, load, dc, rack from system_views.gossip_info; |
| |
| address | port | generation | heartbeat | load | dc | rack |
| -----------+------+------------+-----------+---------+-------------+------- |
| 127.0.0.1 | 7000 | 1645575140 | 312 | 70542.0 | datacenter1 | rack1 |
| 127.0.0.2 | 7000 | 1645575135 | 318 | 70499.0 | datacenter1 | rack1 |
| 127.0.0.3 | 7000 | 1645575140 | 312 | 70504.0 | datacenter1 | rack1 |
| 127.0.0.4 | 7000 | 1645575141 | 311 | 70502.0 | datacenter1 | rack1 |
| 127.0.0.5 | 7000 | 1645575136 | 315 | 70500.0 | datacenter1 | rack1 |
| |
| (5 rows)</pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="other-virtual-tables"><a class="anchor" href="#other-virtual-tables"></a>Other Virtual Tables</h3> |
| <div class="paragraph"> |
| <p>Some examples of using other virtual tables are as follows.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Find tables with most disk usage:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> SELECT * FROM disk_usage WHERE mebibytes > 1 ALLOW FILTERING; |
| |
| keyspace_name | table_name | mebibytes |
| ---------------+------------+----------- |
| keyspace1 | standard1 | 288 |
| tlp_stress | keyvalue | 3211</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Find queries on table/s with greatest read latency:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>cqlsh> SELECT * FROM local_read_latency WHERE per_second > 1 ALLOW FILTERING; |
| |
| keyspace_name | table_name | p50th_ms | p99th_ms | count | max_ms | per_second |
| ---------------+------------+----------+----------+----------+---------+------------ |
| tlp_stress | keyvalue | 0.043 | 0.152 | 49785158 | 186.563 | 11418.356</pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="example"><a class="anchor" href="#example"></a>Example</h2> |
| <div class="sectionbody"> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>To list the keyspaces, enter <code>cqlsh</code> and run the CQL command <code>DESCRIBE KEYSPACES</code>:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql">cqlsh> DESC KEYSPACES; |
| system_schema system system_distributed system_virtual_schema |
| system_auth system_traces system_views</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>To view the virtual table schema, run the CQL commands <code>USE system_virtual_schema</code> and <code>SELECT * FROM tables</code>:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql">cqlsh> USE system_virtual_schema; |
| cqlsh> SELECT * FROM tables;</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>results in:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql"> keyspace_name | table_name | comment |
| -----------------------+---------------------------+-------------------------------------- |
| system_views | caches | system caches |
| system_views | clients | currently connected clients |
| system_views | coordinator_read_latency | |
| system_views | coordinator_scan_latency | |
| system_views | coordinator_write_latency | |
| system_views | disk_usage | |
| system_views | internode_inbound | |
| system_views | internode_outbound | |
| system_views | local_read_latency | |
| system_views | local_scan_latency | |
| system_views | local_write_latency | |
| system_views | max_partition_size | |
| system_views | rows_per_read | |
| system_views | settings | current settings |
| system_views | sstable_tasks | current sstable tasks |
| system_views | system_properties | Cassandra relevant system properties |
| system_views | thread_pools | |
| system_views | tombstones_per_read | |
| system_virtual_schema | columns | virtual column definitions |
| system_virtual_schema | keyspaces | virtual keyspace definitions |
| system_virtual_schema | tables | virtual table definitions |
| |
| (21 rows)</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>To view the virtual tables, run the CQL commands <code>USE system_view</code> and <code>DESCRIBE tables</code>:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql">cqlsh> USE system_view;; |
| cqlsh> DESCRIBE tables;</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>results in:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql">sstable_tasks clients coordinator_write_latency |
| disk_usage local_write_latency tombstones_per_read |
| thread_pools internode_outbound settings |
| local_scan_latency coordinator_scan_latency system_properties |
| internode_inbound coordinator_read_latency max_partition_size |
| local_read_latency rows_per_read caches</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="4"> |
| <li> |
| <p>To look at any table data, run the CQL command <code>SELECT</code>:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql">cqlsh> USE system_view;; |
| cqlsh> SELECT * FROM clients LIMIT 2;</code></pre> |
| </div> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>results in:</pre> |
| </div> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-cql hljs" data-lang="cql"> address | port | connection_stage | driver_name | driver_version | hostname | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username |
| -----------+-------+------------------+------------------------+----------------+-----------+------------------+---------------+------------------+-------------+--------------+----------- |
| 127.0.0.1 | 37308 | ready | DataStax Python Driver | 3.21.0.post0 | localhost | 4 | 17 | null | False | null | anonymous |
| 127.0.0.1 | 37310 | ready | DataStax Python Driver | 3.21.0.post0 | localhost | 4 | 8 | null | False | null | anonymous |
| |
| (2 rows)</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </article> |
| </main> |
| </div> |
| </div> |
| <footer class="grad grad--two flex-center pb-xlarge"> |
| <div class="inner text-center z2 relative"> |
| <h2 class="white py-small">Get started with Cassandra, fast.</h2> |
| <a id="footer-cta" href="/_/quickstart.html" class="btn btn--filled ma-medium">Quickstart Guide</a> |
| </div> |
| <div class="inner flex flex-distribute-items mt-xlarge z2 relative"> |
| <div class="col-2"> |
| <div id="footer-logo" class="logo logo--footer mb-medium"><img src="../../../../assets/img/logo-white-r.png" alt="Cassandra Logo"></div> |
| <p>Apache Cassandra<img src="../../../../assets/img/registered.svg" alt="®" style="width:18px;"> powers mission-critical deployments with improved performance and unparalleled levels of scale in the cloud.</p> |
| <div class="footer-social-icons"> |
| <a href="https://twitter.com/cassandra?lang=en" target="_blank"><img src="../../../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a> |
| <a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank"><img src="../../../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a> |
| <a href="https://www.youtube.com/c/PlanetCassandra" target="_blank"><img src="../../../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a> |
| </div> |
| </div> |
| <div class="col-2 flex flex-center"> |
| <ul class="columns-2"> |
| <li class="mb-small"><a href="/">Home</a></li> |
| <li class="mb-small"><a href="/_/cassandra-basics.html">Cassandra Basics</a></li> |
| <li class="mb-small"><a href="/_/quickstart.html">Quickstart</a></li> |
| <li class="mb-small"><a href="/_/ecosystem.html">Ecosystem</a></li> |
| <li class="mb-small"><a href="/doc/latest/">Documentation</a></li> |
| <li class="mb-small"><a href="/_/community.html">Community</a></li> |
| <li class="mb-small"><a href="/_/case-studies.html">Case Studies</a></li> |
| <li class="mb-small"><a href="/_/resources.html">Resources</a></li> |
| <li class="mb-small"><a href="/_/blog.html">Blog</a></li> |
| </ul> |
| </div> |
| </div> |
| </footer> |
| <div class="lower-footer bg-white pa-medium"> |
| <div class="flex flex-row flex-vert-center"> |
| <div class="pr-medium"><img src="../../../../assets/img//feather-small.png" alt="ASF" width="20"></div> |
| <div class="pr-medium"><a href="http://www.apache.org/" target="_blank">Foundation</a></div> |
| <div class="pr-medium"><a href="https://www.apache.org/events/current-event.html" target="_blank">Events</a></div> |
| <div class="pr-medium"><a href="https://www.apache.org/licenses/" target="_blank">License</a></div> |
| <div class="pr-medium"><a href="https://www.apache.org/foundation/thanks" target="_blank">Thanks</a></div> |
| <div class="pr-medium"><a href="https://www.apache.org/security" target="_blank">Security</a></div> |
| <div class="pr-medium"><a href="https://privacy.apache.org/policies/privacy-policy-public.html" target="_blank">Privacy</a></div> |
| <div class="pr-medium"><a href="https://www.apache.org/foundation/sponsorship" target="_blank">Sponsorship</a></div> |
| </div> |
| <p class="my-medium">© 2009-<script>document.write(new Date().getFullYear())</script> <a href="https://apache.org" target="_blank">The Apache Software Foundation</a> under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation.</p> |
| </div> |
| <div id="fade" class="hidden"></div> |
| <div id="modal" class="hidden"> |
| <div id="close-modal" class="cursor-pointer"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></div> |
| <div id="mod-content" class="vid-mod-content resp-container"></div> |
| </div> |
| <script src="../../../../assets/js/site.js"></script> |
| <script async src="../../../../assets/js/vendor/highlight.js"></script> |
| <script src="../../../../assets/js/vendor/lunr.js"></script> |
| <script src="../../../../assets/js/vendor/search.js" id="search-script" data-base-path="../../../.." data-page-path="/Cassandra/4.1/cassandra/new/virtualtables.html"></script> |
| <script async src="../../../../assets/../search-index.js"></script> |
| <script> |
| jQuery(function(){ |
| var windowW = $(window).width(); |
| $(document) |
| .on('click','.mobile-nav-icon',function(){ |
| $('.main-nav').fadeIn(); |
| }) |
| .on('click','.main-nav',function(){ |
| if(windowW <= 1000){ |
| $(this).fadeOut(); |
| } |
| }) |
| .on('click','#version-toggle',function(){ |
| $(this).toggleClass('active'); |
| $(this).next().fadeToggle(); |
| }) |
| .on('click','#mobile-docs-nav-burger', function(){ |
| $(this).toggleClass('active'); |
| $('.docs-nav').toggleClass('active'); |
| }); |
| var url = window.location.pathname; |
| var isQuickstart = url.includes('quickstart.html'); |
| if(isQuickstart){ |
| var footerCTA = document.getElementById('footer-cta'); |
| footerCTA.innerHTML = 'Get latest updates'; |
| footerCTA.setAttribute('href', '/_/blog.html'); |
| } |
| }); |
| </script> |
| </div> |
| </body> |
| </html> |