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

executor: only show valid columns in stats_histogram #9487

Merged
merged 4 commits into from
Feb 28, 2019

Conversation

eurekaka
Copy link
Contributor

What problem does this PR solve?

Fix #9479

What is changed and how it works?

Check if the column is valid or loaded before appending it to result of show stats_histograms.

Check List

Tests

  • Unit test

Code changes

N/A

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch

@eurekaka eurekaka added type/bugfix This PR fixes a bug. component/statistics sig/execution SIG execution labels Feb 27, 2019
@eurekaka
Copy link
Contributor Author

/run-all-tests

@codecov-io
Copy link

codecov-io commented Feb 27, 2019

Codecov Report

Merging #9487 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9487      +/-   ##
==========================================
- Coverage   67.42%   67.41%   -0.02%     
==========================================
  Files         373      373              
  Lines       78568    78570       +2     
==========================================
- Hits        52976    52965      -11     
- Misses      20837    20845       +8     
- Partials     4755     4760       +5
Impacted Files Coverage Δ
statistics/table.go 83.11% <100%> (ø) ⬆️
executor/show_stats.go 89.92% <100%> (+0.14%) ⬆️
ddl/delete_range.go 75.13% <0%> (-5.3%) ⬇️
store/tikv/lock_resolver.go 41.7% <0%> (-0.95%) ⬇️
expression/schema.go 93.75% <0%> (-0.79%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddbf60f...8be0f9d. Read the comment docs.

@zz-jason zz-jason requested review from alivxxx and winoros and removed request for alivxxx February 27, 2019 08:01
@@ -82,6 +82,9 @@ func (e *ShowExec) appendTableForStatsHistograms(dbName, tblName, partitionName
return
}
for _, col := range statsTbl.Columns {
if col.IsInvalid(nil, false) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not pass sc here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to mark column stats needed in show stats_histograms?

Copy link
Member

Choose a reason for hiding this comment

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

how about adding a comment like "pass a nil StatementContext to avoid column stats being marked as needed"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment added, PTAL

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 27, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 28, 2019
@eurekaka eurekaka merged commit 69f2749 into pingcap:master Feb 28, 2019
@eurekaka eurekaka deleted the panic_show branch February 28, 2019 05:06
eurekaka added a commit to eurekaka/tidb that referenced this pull request Feb 28, 2019
eurekaka added a commit to eurekaka/tidb that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants