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

auto analyze has not been triggered if there is minimal change in data #51972

Closed
aytrack opened this issue Mar 21, 2024 · 0 comments · Fixed by #51978
Closed

auto analyze has not been triggered if there is minimal change in data #51972

aytrack opened this issue Mar 21, 2024 · 0 comments · Fixed by #51978

Comments

@aytrack
Copy link
Contributor

aytrack commented Mar 21, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. disable auto analyze with set start and end time
set global tidb_auto_analyze_start_time='00:00 +0000';
set global tidb_auto_analyze_end_time='00:00 +0000';
  1. create table ad insert about 10000000 rows and analyze table
CREATE TABLE `t` (
  `a` int(11) NOT NULL AUTO_INCREMENT,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- insert into t values ... ,  about 10000000 rows
analyze table t;
  1. insert 3000 rows and enable auto analyze , set tidb_auto_analyze_ratio
insert into t (b) select b + 1 from t limit 3000;
set global tidb_auto_analyze_start_time='00:00 +0000';
set global tidb_auto_analyze_end_time='23:59 +0000';
set global tidb_auto_analyze_ratio = 0.0001;
  1. wait some time to check if triage the auto analyze

2. What did you expect to see? (Required)

triage auto analyze

3. What did you see instead (Required)

not triage auto analyze , introduced by #51537

[2024/03/21 13:41:12.593 +08:00] [INFO] [refresher.go:119] ["No table to analyze"] [category=stats]
[2024/03/21 13:41:15.543 +08:00] [INFO] [refresher.go:205] ["Table is not ready to analyze"] [category=stats] [reason="weight is not positive"] [job="NonPartitionedTableAnalysisJob:\n\tAnalyzeType: analyzeTable\n\tIndexes: \n\tSchema: TICASE_5407_MRCAIR\n\tTable: t\n\tTableID: 109\n\tTableStatsVer: 2\n\tChangePercentage: 0.00\n\tTableSize: 20006000.00\n\tLastAnalysisDuration: 1h51m25.537s\n\tWeight: 0.0000\n"]
[2024/03/21 13:41:15.543 +08:00] [INFO] [refresher.go:119] ["No table to analyze"] [category=stats]
[2024/03/21 13:41:18.541 +08:00] [INFO] [refresher.go:205] ["Table is not ready to analyze"] [category=stats] [reason="weight is not positive"] [job="NonPartitionedTableAnalysisJob:\n\tAnalyzeType: analyzeTable\n\tIndexes: \n\tSchema: TICASE_5407_MRCAIR\n\tTable: t\n\tTableID: 109\n\tTableStatsVer: 2\n\tChangePercentage: 0.00\n\tTableSize: 20006000.00\n\tLastAnalysisDuration: 1h51m28.537s\n\tWeight: 0.0000\n"]
[2024/03/21 13:41:18.541 +08:00] [INFO] [refresher.go:119] ["No table to analyze"] [category=stats]

4. What is your TiDB version? (Required)

v8.0.0-pre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants