Write and Run Queries

  • Capella Columnar
  • reference
    +
    To query data in Capella Columnar collections you use SQL++, a SQL-for-JSON language specification that is similar to SQL.

    To support the full feature set of Capella Columnar services, SQL++ for Capella columnar, a customized and extended version of the SQL++ for Capella columnar query language, is available. See SQL++ for Capella Columnar.

    Capella Columnar uses rule-based optimization to query your collections until you run an ANALYZE COLLECTION statement on each collection involved in a query. As the data in a collection changes, you can run ANALYZE COLLECTION periodically to update the information used for CBO. See Cost-Based Optimizer for Capella Columnar Services.

    Prerequisites

    To use the workbench for Capella Columnar:

    Using the Query Editor

    The query editor is where you build and run queries. You can use the query editor’s Query Context lists to set the database and scope you want a query to use.

    You use SQL++ for Capella columnar to write queries. For information about the SQL++ statements and syntax you use in Capella Columnar, see DDL Statements and DML Statements.

    Since large result sets can take a long time to display, it’s recommended that you use the LIMIT clause as part of your query when appropriate.

    The query editor provides syntax highlighting. For easy viewing, SQL++ for Capella columnar keywords, numbers, and string literals are differently colored.

    You can use the query options to define request-level parameters, change the query timeout period, and so on. See Set Query Options.

    After entering a query, you can run the query to view the results. You can also view metrics and the query plan.

    Run a Query

    After you enter a query, click Run Query.

    You can also execute a query by typing a semicolon ; at the end of the query and then using the Enter key.

    While the query is running, the Run Query button changes to Cancel, which allows you to cancel the running query. You can also cancel DDL and DML statements. When you cancel a running query or statement, it stops the activity on the data source side as well.

    When a query runs to completion, its results appear below the query editor in the query results pane.