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

reference: add sql diagnosis overview #2172

Merged
merged 5 commits into from
Apr 7, 2020
Merged

Conversation

TomShawn
Copy link
Contributor

@TomShawn TomShawn commented Apr 5, 2020

What is changed, added or deleted? (Required)

Add the SQL diagnosis overview.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

If you select two or more versions from above, to trigger the bot to cherry-pick this PR to your desired release version branch(es), you must add corresponding labels such as needs-cherry-pick-4.0, needs-cherry-pick-3.1, needs-cherry-pick-3.0, and needs-cherry-pick-2.1.

What is the related PR or file link(s)?

@TomShawn TomShawn added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. needs-cherry-pick-4.0 labels Apr 5, 2020
@TomShawn TomShawn requested a review from reafans April 5, 2020 02:21
@reafans
Copy link
Contributor

reafans commented Apr 7, 2020

LGTM

@TomShawn TomShawn requested a review from lilin90 April 7, 2020 03:43
@@ -0,0 +1,50 @@
---
title: SQL Diagnosis
summary: Understand SQL diagnostics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest keeping the wording consistent.

Suggested change
summary: Understand SQL diagnostics.
summary: Understand SQL diagnosis in TiDB.

category: reference
---

# SQL diagnosis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# SQL diagnosis
# SQL Diagnosis


# SQL diagnosis

SQL diagnosis is a feature introduced since TiDB v4.0. You can use this feature to locate problems in TiDB with higher efficiency. Before TiDB v4.0, you need to use different tools to obtain different information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SQL diagnosis is a feature introduced since TiDB v4.0. You can use this feature to locate problems in TiDB with higher efficiency. Before TiDB v4.0, you need to use different tools to obtain different information.
SQL diagnosis is a feature introduced in TiDB v4.0. You can use this feature to locate problems in TiDB with higher efficiency. Before TiDB v4.0, you need to use different tools to obtain different information.


SQL diagnosis is a feature introduced since TiDB v4.0. You can use this feature to locate problems in TiDB with higher efficiency. Before TiDB v4.0, you need to use different tools to obtain different information.

The SQL diagnosis system integrates information from all components of the system as a whole, provides a consistent interface to the upper layer through system tables, and provides monitoring summaries and automatic diagnosis, which makes it easier for you to query cluster information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One sentence is a bit too long.

Suggested change
The SQL diagnosis system integrates information from all components of the system as a whole, provides a consistent interface to the upper layer through system tables, and provides monitoring summaries and automatic diagnosis, which makes it easier for you to query cluster information.
The SQL diagnosis system integrates information from all components of the system as a whole, provides a consistent interface to the upper layer through system tables, and provides the monitoring summary and automatic diagnosis. All these make it easier to query cluster information.


+ **Cluster information table**: The SQL diagnosis system adds cluster information tables that provide a unified way to get the discrete information of each instance and node. This system fully integrates the cluster topology, hardware information, software information, kernel parameters, monitoring, system information, slow queries, statements, and logs of the entire cluster into the table, allowing you to query these information using SQL statements.

+ **Cluster monitoring table**: The SQL diagnosis system adds cluster monitoring tables. All of these tables are in `metrics_schema`, and you can query monitoring information using SQL statements. Compared to the visualized monitoring before v4.0, you can use this SQL-based method to perform correlated queries on all the monitoring information of the entire cluster, and compare the results of different time periods to quickly identify performance bottlenecks. Because the TiDB cluster has many monitoring metrics, the SQL diagnosis system also provides monitoring summary tables, which allows you to more easily find abnormal monitoring items.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ **Cluster monitoring table**: The SQL diagnosis system adds cluster monitoring tables. All of these tables are in `metrics_schema`, and you can query monitoring information using SQL statements. Compared to the visualized monitoring before v4.0, you can use this SQL-based method to perform correlated queries on all the monitoring information of the entire cluster, and compare the results of different time periods to quickly identify performance bottlenecks. Because the TiDB cluster has many monitoring metrics, the SQL diagnosis system also provides monitoring summary tables, which allows you to more easily find abnormal monitoring items.
+ **Cluster monitoring table**: The SQL diagnosis system adds cluster monitoring tables. All of these tables are in `metrics_schema`, and you can query monitoring information using SQL statements. Compared to the visualized monitoring before v4.0, you can use this SQL-based method to perform correlated queries on all the monitoring information of the entire cluster, and compare the results of different time periods to quickly identify performance bottlenecks. Because the TiDB cluster has many monitoring metrics, the SQL diagnosis system also provides monitoring summary tables, so you can find abnormal monitoring items more easily.

+ On the cluster hardware table `information_schema.cluster_hardware`, you can quickly query the cluster hardware information.
+ On the cluster load table `information_schema.cluster_load`, you can query the load information of different nodes and hardware types of the cluster.
+ On the kernel parameter table `information_schema.cluster_systeminfo`, you can query the kernel configuration information of different nodes in the cluster. Currently, TiDB supports querying the sysctl information.
+ On the cluster log table `information_schema.cluster_log`, you can query cluster logs. By pushing the query condition to each node, the impact of the query on cluster performance is less than that of the grep command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ On the cluster log table `information_schema.cluster_log`, you can query cluster logs. By pushing the query condition to each node, the impact of the query on cluster performance is less than that of the grep command.
+ On the cluster log table `information_schema.cluster_log`, you can query cluster logs. By pushing down query conditions to each node, the impact of the query on cluster performance is less than that of the `grep` command.

+ On the kernel parameter table `information_schema.cluster_systeminfo`, you can query the kernel configuration information of different nodes in the cluster. Currently, TiDB supports querying the sysctl information.
+ On the cluster log table `information_schema.cluster_log`, you can query cluster logs. By pushing the query condition to each node, the impact of the query on cluster performance is less than that of the grep command.

On the system tables before v4.0, you can only view the current node. TiDB v4.0 adds the corresponding cluster tables and you can have a global view of the entire cluster on a single TiDB node. These tables are currently in `information_schema`, and the query method is the same as other `information_schema` system tables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
On the system tables before v4.0, you can only view the current node. TiDB v4.0 adds the corresponding cluster tables and you can have a global view of the entire cluster on a single TiDB node. These tables are currently in `information_schema`, and the query method is the same as other `information_schema` system tables.
On the system tables earlier than TiDB v4.0, you can only view the current node. TiDB v4.0 adds the corresponding cluster tables and you can have a global view of the entire cluster on a single TiDB node. These tables are currently in `information_schema`, and the query method is the same as other `information_schema` system tables.


## Cluster monitoring tables

For you to dynamically observe and compare cluster conditions in different time periods, the SQL diagnosis system adds cluster monitoring system tables. All monitoring tables are in `metrics_schema`, and you can query the monitoring information SQL statements. Using this method, you can perform correlated queries on all monitoring information of the entire cluster and compare the results of different time periods to quickly identify performance bottlenecks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For you to dynamically observe and compare cluster conditions in different time periods, the SQL diagnosis system adds cluster monitoring system tables. All monitoring tables are in `metrics_schema`, and you can query the monitoring information SQL statements. Using this method, you can perform correlated queries on all monitoring information of the entire cluster and compare the results of different time periods to quickly identify performance bottlenecks.
To dynamically observe and compare cluster conditions in different time periods, the SQL diagnosis system introduces cluster monitoring system tables. All monitoring tables are in `metrics_schema`, and you can query the monitoring information SQL statements. Using this method, you can perform correlated queries on all monitoring information of the entire cluster and compare the results of different time periods to quickly identify performance bottlenecks.


+ `information_schema.metrics_tables`: Because many system tables exist now, you can query meta-information of these monitoring tables on the `information_schema.metrics_tables` table.

Because the TiDB cluster has many monitoring metrics, TiDB provides the following monitoring summary tables since v4.0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Because the TiDB cluster has many monitoring metrics, TiDB provides the following monitoring summary tables since v4.0:
Because the TiDB cluster has many monitoring metrics, TiDB provides the following monitoring summary tables in v4.0:

reference/system-databases/sql-diagnosis.md Outdated Show resolved Hide resolved
Copy link
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lilin90 lilin90 added the status/can-merge Indicates a PR has been approved by a committer. label Apr 7, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

/run-all-tests

@lilin90 lilin90 added the v4.0 This PR/issue applies to TiDB v4.0. label Apr 7, 2020
@sre-bot sre-bot merged commit f7d7a44 into pingcap:master Apr 7, 2020
sre-bot pushed a commit to sre-bot/docs that referenced this pull request Apr 7, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

cherry pick to release-4.0 in PR #2183

lilin90 pushed a commit that referenced this pull request Apr 7, 2020
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@TomShawn TomShawn deleted the sql-diagnosis branch April 7, 2020 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v4.0 This PR/issue applies to TiDB v4.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants