Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Performance section to SHOW TABLES page #10249

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added Performance section to SHOW TABLES page
  • Loading branch information
ericharmeling committed Apr 7, 2021
commit df8b4cc1ba453680da0a6ca33e5ece0c2d56d991
11 changes: 7 additions & 4 deletions v21.1/show-tables.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@ toc: true

The `SHOW TABLES` [statement](sql-statements.html) lists the schema, table name, table type, owner, and estimated row count for the tables or [views](views.html) in a schema or database.

{{site.data.alerts.callout_success}}
Estimating the number of rows in a table costs resources. To improve the performance of `SHOW TABLES` queries, disable row-count estimation by setting the `sql.show_tables.estimated_row_count.enabled` [cluster setting](cluster-settings.html) to `false` before executing a `SHOW TABLES` statement.
{{site.data.alerts.end}}

{{site.data.alerts.callout_info}}
While a table or view is being [dropped](drop-table.html), `SHOW TABLES` will list the object with a `(dropped)` suffix.
{{site.data.alerts.end}}
@@ -36,6 +32,13 @@ When a `database_name` and `schema_name` are omitted, the tables of the [current

`SHOW TABLES` will attempt to find a schema with the specified name first. If that fails, it will try to find a database with that name instead, and list the tables of its `public` schema. For more details, see [Name Resolution](sql-name-resolution.html).

## Performance

To optimize the performance of the `SHOW TABLES` statement, you can do the following:

- Disable table row-count estimation by setting the `sql.show_tables.estimated_row_count.enabled` [cluster setting](cluster-settings.html) to `false` before executing a `SHOW TABLES` statement.
- Avoid running `SHOW TABLES` on databases with a large number of tables (e.g., more than 10,000 tables).

## Examples

{% include {{page.version.version}}/sql/movr-statements.md %}