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

infoschema: fix select * from inspection_summary would return null. #16099

Merged
merged 13 commits into from
Apr 10, 2020
Merged

infoschema: fix select * from inspection_summary would return null. #16099

merged 13 commits into from
Apr 10, 2020

Conversation

reafans
Copy link
Contributor

@reafans reafans commented Apr 7, 2020

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

  1. Currently it would return empty results without rule condition.

What is changed and how it works?

  1. Make it return all the results for select * from inspection.
  2. Add a column name COMMENT to explain the row.

What's Changed:
before:

mysql> select * from inspection_summary;
Empty set (0.00 sec)

this pr :

mysql> select * from inspection_summary limit 10;
+-------+------------------+------------------------------------------+----------------+----------+-----------+-----------+-----------+------------------------------------------------------------------------------------------------------+
| RULE  | INSTANCE         | METRICS_NAME                             | LABEL          | QUANTILE | AVG_VALUE | MIN_VALUE | MAX_VALUE | COMMENT                                                                                              |
+-------+------------------+------------------------------------------+----------------+----------+-----------+-----------+-----------+------------------------------------------------------------------------------------------------------+
| stats | gncluster-tidb-0 | tidb_statistics_auto_analyze_duration    |                |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB auto analyze time durations within 95 percent histogram buckets                 |
| stats | gncluster-tidb-0 | tidb_statistics_fast_analyze_status      | access_regions |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB fast analyze statistics                                                         |
| stats | gncluster-tidb-0 | tidb_statistics_fast_analyze_status      | region_error   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB fast analyze statistics                                                         |
| stats | gncluster-tidb-0 | tidb_statistics_fast_analyze_status      | sample         |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB fast analyze statistics                                                         |
| stats | gncluster-tidb-0 | tidb_statistics_fast_analyze_status      | scan_keys      |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB fast analyze statistics                                                         |
| stats | gncluster-tidb-0 | tidb_statistics_fast_analyze_status      | seek_keys      |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB fast analyze statistics                                                         |
| stats |                  | tidb_statistics_pseudo_estimation_ops    |                |     NULL |  0.000000 |  0.000000 |  0.000000 | TiDB optimizer using pseudo estimation counts                                                        |
| stats |                  | tidb_statistics_significant_feedback     |                |     NULL |  0.000000 |  0.000000 |  0.000000 | Counter of query feedback whose actual count is much different than calculated by current statistics |
| stats | gncluster-tidb-0 | tidb_statistics_stats_inaccuracy_rate    |                |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB statistics inaccurate rate                                                      |
| stats | gncluster-tidb-0 | tidb_statistics_store_query_feedback_qps | ok             |     NULL |  0.044445 |  0.044443 |  0.044445 | TiDB store quering feedback counts                                                                   |
+-------+------------------+------------------------------------------+----------------+----------+-----------+-----------+-----------+------------------------------------------------------------------------------------------------------+
10 rows in set (21.26 sec)

mysql> select * from inspection_summary where rule='query-summary' and metrics_name='tidb_query_duration';
+---------------+------------------+---------------------+----------+----------+-----------+-----------+-----------+----------------------------------------------+
| RULE          | INSTANCE         | METRICS_NAME        | LABEL    | QUANTILE | AVG_VALUE | MIN_VALUE | MAX_VALUE | COMMENT                                      |
+---------------+------------------+---------------------+----------+----------+-----------+-----------+-----------+----------------------------------------------+
| query-summary | gncluster-tidb-0 | tidb_query_duration | Begin    |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Commit   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Delete   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Execute  |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Insert   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Replace  |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Rollback |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Select   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Set      |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Show     |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Update   |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | Use      |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | general  |     0.99 |  0.000000 |  0.000000 |  0.000000 | The quantile of TiDB query durations(second) |
| query-summary | gncluster-tidb-0 | tidb_query_duration | internal |     0.99 |  0.004050 |  0.003934 |  0.005480 | The quantile of TiDB query durations(second) |
+---------------+------------------+---------------------+----------+----------+-----------+-----------+-----------+----------------------------------------------+
14 rows in set (0.09 sec)

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:

Check List

Tests

  • Unit test
  • Integration test

Release note

@reafans reafans requested a review from a team as a code owner April 7, 2020 05:42
@ghost ghost requested review from qw4990 and removed request for a team April 7, 2020 05:43
@github-actions github-actions bot added sig/sql-infra SIG: SQL Infra sig/execution SIG execution labels Apr 7, 2020
@reafans reafans changed the title infoschema: fix select * from inspection would return null. infoschema: fix select * from inspection_summary would return null. Apr 7, 2020
@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #16099 into master will not change coverage by %.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #16099   +/-   ##
===========================================
  Coverage   80.4052%   80.4052%           
===========================================
  Files           506        506           
  Lines        136251     136251           
===========================================
  Hits         109553     109553           
  Misses        18182      18182           
  Partials       8516       8516           

@reafans
Copy link
Contributor Author

reafans commented Apr 7, 2020

/run-all-tests

@reafans
Copy link
Contributor Author

reafans commented Apr 7, 2020

/run-integration-copr-test

1 similar comment
@reafans
Copy link
Contributor Author

reafans commented Apr 7, 2020

/run-integration-copr-test

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 8, 2020
infoschema/tables.go Outdated Show resolved Hide resolved
@qw4990 qw4990 removed their request for review April 9, 2020 08:01
Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@reafans
Copy link
Contributor Author

reafans commented Apr 10, 2020

/merge

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

sre-bot commented Apr 10, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Apr 10, 2020

@reafans merge failed.

@reafans
Copy link
Contributor Author

reafans commented Apr 10, 2020

/run-integration-copr-test

@reafans
Copy link
Contributor Author

reafans commented Apr 10, 2020

/run-sqllogic-test-2

@reafans reafans removed the status/can-merge Indicates a PR has been approved by a committer. label Apr 10, 2020
@reafans
Copy link
Contributor Author

reafans commented Apr 10, 2020

/merge

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

sre-bot commented Apr 10, 2020

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants