19. SHOW TABLE#

19.1. Synopsis#

SHOW TABLE

{ <tables> | <find_expression> } [, ... ]

find_expression ::=
  FIND (
    { TAG = <tag_value> | NOT TAG = <tag_value>
      | PREFIX = 'prefix' | SUFFIX = 'suffix' | TYPE = TS }
    [ AND ... ] [ , RECURSIVE = { TRUE | FALSE } ]
  )

tag_value ::= { 'text' | $table } [ || ... ]

19.2. Description#

SHOW TABLE returns the schema of each specified table. The result includes the columns, column types, shard size, time-to-live value and partition policy. The partition_by field is planned for QuasarDB 4.0.0 and is present on the current development branch. The command supports time-series tables, general tables, and aggregated tables.

19.3. Partition policy#

partition_by contains one of these values:

  • TIMESTAMP($timestamp) for default timestamp sharding.

  • The key column name for distinct-value partitioning.

  • HASH(key) PARTITIONS n for hash partitioning.

  • RANGE(key, width) for integer-range partitioning.

  • TIMESTAMP(key) for a selected TIMESTAMP column.

The name reflects a renamed partition key. shard_size is expressed in milliseconds and gives the selected timestamp partition duration; distinct, hash and range layouts report the infinite-size sentinel 9223372036854775807. It does not describe a second level of time shards. For an ordinary TIMESTAMP key, its interval does not bound the rows’ $timestamp.

$sys.tables exposes the same partition_by field. See Column partitioning for the layout semantics and limitations.

19.4. Parameters#

entries

The names of the tables whose schemas QuasarDB returns.

find_expression

Selects multiple tables with a key/value lookup. For more information, refer to key/value lookups.

19.5. Examples#

Show information for the table “sensors”:

SHOW TABLE sensors

Inspect partition policies through the system table:

SELECT name, column, partition_by
FROM $sys.tables WHERE name = 'sensor_readings';