Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›SQL ›SQL Language

SHOW TABLES

Synopsis:

SHOW TABLES
    [CATALOG [catalog_identifier | 
              LIKE pattern]]?      
    [INCLUDE FROZEN]?              
    [table_identifier |            
     LIKE pattern]?                

Catalog (cluster) identifier. Supports wildcards (*).

SQL LIKE pattern matching catalog names.

Whether or not to include frozen indices.

Single table (index or data stream) identifier or double-quoted multi-target pattern.

SQL LIKE pattern matching table names.

See index patterns for more information about patterns.

Description: List the tables available to the current user and their type.

SHOW TABLES;

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX
javaRestTest      |employees      |VIEW      |ALIAS
javaRestTest      |library        |TABLE     |INDEX

Match multiple indices by using Elasticsearch multi-target syntax notation:

SHOW TABLES "*,-l*";

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX
javaRestTest      |employees      |VIEW      |ALIAS

One can also use the LIKE clause to restrict the list of names to the given pattern.

The pattern can be an exact match:

SHOW TABLES LIKE 'emp';

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX

Multiple chars:

SHOW TABLES LIKE 'emp%';

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX
javaRestTest      |employees      |VIEW      |ALIAS

A single char:

SHOW TABLES LIKE 'em_';

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX

Or a mixture of single and multiple chars:

SHOW TABLES LIKE '%em_';

 catalog       |     name      | type     |     kind
---------------+---------------+----------+---------------
javaRestTest      |emp            |TABLE     |INDEX

List tables within remote clusters whose names are matched by a wildcard:

SHOW TABLES CATALOG 'my_*' LIKE 'test_emp%';

     catalog     |     name      |     type      |     kind
-----------------+---------------+---------------+---------------
my_remote_cluster|test_emp       |TABLE          |INDEX
my_remote_cluster|test_emp_copy  |TABLE          |INDEX

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/sql-syntax-show-tables.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API