原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/sql-syntax-show-tables.html, 原文档版权归 www.elastic.co 所有
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
SHOW TABLESedit
Synopsis:
Whether or not to include frozen indices |
|
single table identifier or double quoted es multi index |
|
SQL LIKE pattern |
See index patterns for more information about patterns.
Description: List the tables available to the current user and their type.
SHOW TABLES; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX employees |VIEW |ALIAS library |BASE TABLE |INDEX
Match multiple indices by using Elasticsearch multi index syntax notation:
SHOW TABLES "*,-l*"; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX 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'; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX
Multiple chars:
SHOW TABLES LIKE 'emp%'; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX employees |VIEW |ALIAS
A single char:
SHOW TABLES LIKE 'em_'; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX
Or a mixture of single and multiple chars:
SHOW TABLES LIKE '%em_'; name | type | kind ---------------+---------------+--------------- emp |BASE TABLE |INDEX