DOCAPI-8799: Updated SHOW TABLE dscr. Restructured TOC (#7128)

* Typo fix.

* Links fix.

* Fixed links in docs.

* More fixes.

* Link fixes.

* DOCAPI-8799: Updated SHOW TABLES. Restructured TOC.

* DOCAPI-8799: Fix.

* DOCAPI-8799: Links fix.
This commit is contained in:
BayoNet 2019-09-27 18:44:36 +03:00 committed by GitHub
parent dad401a047
commit a04756d0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 127 additions and 106 deletions

View File

@ -61,7 +61,7 @@ ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the `c
The default database.
To get a list of databases, use the [SHOW DATABASES](../../query_language/misc.md#show-databases) query.
To get a list of databases, use the [SHOW DATABASES](../../query_language/show.md#show-databases) query.
**Example**

View File

@ -214,72 +214,6 @@ SET profile = 'profile-name-from-the-settings-file'
For more information, see [Settings](../operations/settings/settings.md).
## SHOW CREATE TABLE
```sql
SHOW CREATE [TEMPORARY] TABLE [db.]table [INTO OUTFILE filename] [FORMAT format]
```
Returns a single `String`-type 'statement' column, which contains a single value the `CREATE` query used for creating the specified table.
## SHOW DATABASES {#show-databases}
```sql
SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
```
Prints a list of all databases.
This query is identical to `SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]`.
See also the section "Formats".
## SHOW PROCESSLIST
```sql
SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format]
```
Outputs a list of queries currently being processed, other than `SHOW PROCESSLIST` queries.
Prints a table containing the columns:
**user** The user who made the query. Keep in mind that for distributed processing, queries are sent to remote servers under the 'default' user. SHOW PROCESSLIST shows the username for a specific query, not for a query that this query initiated.
**address** The name of the host that the query was sent from. For distributed processing, on remote servers, this is the name of the query requestor host. To track where a distributed query was originally made from, look at SHOW PROCESSLIST on the query requestor server.
**elapsed** The execution time, in seconds. Queries are output in order of decreasing execution time.
**rows_read**, **bytes_read** How many rows and bytes of uncompressed data were read when processing the query. For distributed processing, data is totaled from all the remote servers. This is the data used for restrictions and quotas.
**memory_usage** Current RAM usage in bytes. See the setting 'max_memory_usage'.
**query** The query itself. In INSERT queries, the data for insertion is not output.
**query_id** The query identifier. Non-empty only if it was explicitly defined by the user. For distributed processing, the query ID is not passed to remote servers.
This query is nearly identical to: `SELECT * FROM system.processes`. The difference is that the `SHOW PROCESSLIST` query does not show itself in a list, when the `SELECT .. FROM system.processes` query does.
Tip (execute in the console):
```bash
$ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
```
## SHOW TABLES
```sql
SHOW [TEMPORARY] TABLES [FROM db] [LIKE 'pattern'] [INTO OUTFILE filename] [FORMAT format]
```
Displays a list of tables
- Tables from the current database, or from the 'db' database if "FROM db" is specified.
- All tables, or tables whose name matches the pattern, if "LIKE 'pattern'" is specified.
This query is identical to: `SELECT name FROM system.tables WHERE database = 'db' [AND name LIKE 'pattern'] [INTO OUTFILE filename] [FORMAT format]`.
See also the section "LIKE operator".
## TRUNCATE
```sql

View File

@ -0,0 +1,82 @@
# SHOW Queries
## SHOW CREATE TABLE
```sql
SHOW CREATE [TEMPORARY] TABLE [db.]table [INTO OUTFILE filename] [FORMAT format]
```
Returns a single `String`-type 'statement' column, which contains a single value the `CREATE` query used for creating the specified table.
## SHOW DATABASES {#show-databases}
```sql
SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
```
Prints a list of all databases.
This query is identical to `SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]`.
See also the section "Formats".
## SHOW PROCESSLIST
```sql
SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format]
```
Outputs a list of queries currently being processed, other than `SHOW PROCESSLIST` queries.
Prints a table containing the columns:
**user** The user who made the query. Keep in mind that for distributed processing, queries are sent to remote servers under the 'default' user. SHOW PROCESSLIST shows the username for a specific query, not for a query that this query initiated.
**address** The name of the host that the query was sent from. For distributed processing, on remote servers, this is the name of the query requestor host. To track where a distributed query was originally made from, look at SHOW PROCESSLIST on the query requestor server.
**elapsed** The execution time, in seconds. Queries are output in order of decreasing execution time.
**rows_read**, **bytes_read** How many rows and bytes of uncompressed data were read when processing the query. For distributed processing, data is totaled from all the remote servers. This is the data used for restrictions and quotas.
**memory_usage** Current RAM usage in bytes. See the setting 'max_memory_usage'.
**query** The query itself. In INSERT queries, the data for insertion is not output.
**query_id** The query identifier. Non-empty only if it was explicitly defined by the user. For distributed processing, the query ID is not passed to remote servers.
This query is nearly identical to: `SELECT * FROM system.processes`. The difference is that the `SHOW PROCESSLIST` query does not show itself in a list, when the `SELECT .. FROM system.processes` query does.
Tip (execute in the console):
```bash
$ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
```
## SHOW TABLES
Displays a list of tables.
```sql
SHOW [TEMPORARY] TABLES [FROM <db>] [LIKE '<pattern>'] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
```
If the `FROM` clause is not specified, the query returns the list of tables from the current database.
The same result as the `SHOW TABLES` query returns, you can get by the following way:
```sql
SELECT name FROM system.tables WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
```
**Example**
The following query selects the first two rows from the list of tables in the `system` database, whose names contain `co`.
```sql
SHOW TABLES FROM system LIKE '%co%' LIMIT 2
```
```text
┌─name───────────────────────────┐
│ aggregate_function_combinators │
│ collations │
└────────────────────────────────┘
```

View File

@ -0,0 +1 @@
../../en/query_language/show.md

View File

@ -32,35 +32,6 @@ nav:
- 'Visual Interfaces': 'interfaces/third-party/gui.md'
- 'Proxies': 'interfaces/third-party/proxy.md'
- 'Data Types':
- 'Introduction': 'data_types/index.md'
- 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md'
- 'Float32, Float64': 'data_types/float.md'
- 'Decimal': 'data_types/decimal.md'
- 'Boolean': 'data_types/boolean.md'
- 'String': 'data_types/string.md'
- 'FixedString(N)': 'data_types/fixedstring.md'
- 'UUID': 'data_types/uuid.md'
- 'Date': 'data_types/date.md'
- 'DateTime': 'data_types/datetime.md'
- 'Enum': 'data_types/enum.md'
- 'Array(T)': 'data_types/array.md'
- 'AggregateFunction(name, types_of_arguments...)': 'data_types/nested_data_structures/aggregatefunction.md'
- 'Tuple(T1, T2, ...)': 'data_types/tuple.md'
- 'Nullable': 'data_types/nullable.md'
- 'Nested Data Structures':
- 'hidden': 'data_types/nested_data_structures/index.md'
- 'Nested(Name1 Type1, Name2 Type2, ...)': 'data_types/nested_data_structures/nested.md'
- 'Special Data Types':
- 'hidden': 'data_types/special_data_types/index.md'
- 'Expression': 'data_types/special_data_types/expression.md'
- 'Set': 'data_types/special_data_types/set.md'
- 'Nothing': 'data_types/special_data_types/nothing.md'
- 'Domains':
- 'Overview': 'data_types/domains/overview.md'
- 'IPv4': 'data_types/domains/ipv4.md'
- 'IPv6': 'data_types/domains/ipv6.md'
- 'Database Engines':
- 'Introduction': 'database_engines/index.md'
- 'MySQL': 'database_engines/mysql.md'
@ -105,12 +76,15 @@ nav:
- 'SQL Reference':
- 'hidden': 'query_language/index.md'
- 'SELECT': 'query_language/select.md'
- 'INSERT INTO': 'query_language/insert_into.md'
- 'CREATE': 'query_language/create.md'
- 'ALTER': 'query_language/alter.md'
- 'SYSTEM': 'query_language/system.md'
- 'Other Kinds of Queries': 'query_language/misc.md'
- 'Syntax': 'query_language/syntax.md'
- 'Statements':
- 'SELECT': 'query_language/select.md'
- 'INSERT INTO': 'query_language/insert_into.md'
- 'CREATE': 'query_language/create.md'
- 'ALTER': 'query_language/alter.md'
- 'SYSTEM': 'query_language/system.md'
- 'SHOW': 'query_language/show.md'
- 'Other': 'query_language/misc.md'
- 'Functions':
- 'Introduction': 'query_language/functions/index.md'
- 'Arithmetic': 'query_language/functions/arithmetic_functions.md'
@ -172,7 +146,34 @@ nav:
- 'Dictionary Key and Fields': 'query_language/dicts/external_dicts_dict_structure.md'
- 'Internal Dictionaries': 'query_language/dicts/internal_dicts.md'
- 'Operators': 'query_language/operators.md'
- 'General Syntax': 'query_language/syntax.md'
- 'Data Types':
- 'Introduction': 'data_types/index.md'
- 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md'
- 'Float32, Float64': 'data_types/float.md'
- 'Decimal': 'data_types/decimal.md'
- 'Boolean': 'data_types/boolean.md'
- 'String': 'data_types/string.md'
- 'FixedString(N)': 'data_types/fixedstring.md'
- 'UUID': 'data_types/uuid.md'
- 'Date': 'data_types/date.md'
- 'DateTime': 'data_types/datetime.md'
- 'Enum': 'data_types/enum.md'
- 'Array(T)': 'data_types/array.md'
- 'AggregateFunction(name, types_of_arguments...)': 'data_types/nested_data_structures/aggregatefunction.md'
- 'Tuple(T1, T2, ...)': 'data_types/tuple.md'
- 'Nullable': 'data_types/nullable.md'
- 'Nested Data Structures':
- 'hidden': 'data_types/nested_data_structures/index.md'
- 'Nested(Name1 Type1, Name2 Type2, ...)': 'data_types/nested_data_structures/nested.md'
- 'Special Data Types':
- 'hidden': 'data_types/special_data_types/index.md'
- 'Expression': 'data_types/special_data_types/expression.md'
- 'Set': 'data_types/special_data_types/set.md'
- 'Nothing': 'data_types/special_data_types/nothing.md'
- 'Domains':
- 'Overview': 'data_types/domains/overview.md'
- 'IPv4': 'data_types/domains/ipv4.md'
- 'IPv6': 'data_types/domains/ipv6.md'
- 'Operations':
- 'Introduction': 'operations/index.md'
@ -202,9 +203,6 @@ nav:
- 'clickhouse-copier': 'operations/utils/clickhouse-copier.md'
- 'clickhouse-local': 'operations/utils/clickhouse-local.md'
- 'F.A.Q.':
- 'General Questions': 'faq/general.md'
- 'Development':
- 'hidden': 'development/index.md'
- 'Overview of ClickHouse Architecture': 'development/architecture.md'
@ -219,3 +217,6 @@ nav:
- 'Roadmap': 'roadmap.md'
- 'Changelog': 'changelog.md'
- 'Security Changelog': 'security_changelog.md'
- 'F.A.Q.':
- 'General Questions': 'faq/general.md'

View File

@ -110,6 +110,7 @@ nav:
- 'CREATE': 'query_language/create.md'
- 'ALTER': 'query_language/alter.md'
- 'SYSTEM': 'query_language/system.md'
- 'SYSTEM': 'query_language/show.md'
- 'Other Kinds of Queries': 'query_language/misc.md'
- 'Functions':
- 'Introduction': 'query_language/functions/index.md'

View File

@ -109,6 +109,7 @@ nav:
- 'CREATE': 'query_language/create.md'
- 'ALTER': 'query_language/alter.md'
- 'SYSTEM': 'query_language/system.md'
- 'SHOW': 'query_language/show.md'
- '其他类型的查询': 'query_language/misc.md'
- '函数':
- '介绍': 'query_language/functions/index.md'

View File

@ -0,0 +1 @@
../../en/query_language/show.md