Bug #98132 | Analyze table leads to empty statistics during online rebuild DDL | ||
---|---|---|---|
Submitted: | 6 Jan 2020 10:55 | Modified: | 7 Jan 2020 12:18 |
Reporter: | Qingda Hu | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.6, 5.7, 8.0, 5.7.28, 8.0.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[6 Jan 2020 10:55]
Qingda Hu
[7 Jan 2020 12:18]
MySQL Verification Team
Hello Albert Hu, Thank you for the report. regards, Umesh
[15 Sep 2021 12:16]
MySQL Verification Team
There is a duplicate of this bug in the following one: https://bugs.mysql.com/bug.php?id=104933 which makes this bug a serious one.
[16 Sep 2021 15:39]
Steven Duan
Hi, It is unbelievable that this serious bug is still open in the latest release, 8.0.26. It must have caused many production issues! I guess the bug is not well understood, because the repeat steps do not tell the right point. Note that abnormal index statistics itself is not so important, given that index dive plays a big role. It is n_diff for the primary key that is critical, because it being zero cheats the optimizer that the table is empty. The suggested fix works for me. And I have a dedicated test for it(see the enclosed patch in the next comment). Please reconsider the issue.
[16 Sep 2021 15:40]
Steven Duan
testcase based on MySQL 5.7.35 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bugfix-Online_DDL-leads-to-empty-statistics-of-ANALYZE.patch (application/octet-stream, text), 20.13 KiB.
[4 Jan 2022 9:58]
WANG GUANGYOU
we encounter a similar problem even no online rebuild ddl.
[4 Jan 2022 12:51]
WANG GUANGYOU
I want to know the innodb_stats_persistent option in your server I check the code it only happens in innodb_stats_persistent=off But my server meet full scan in innodb_stats_persistent=on and no online ddl
[4 Jan 2022 12:51]
WANG GUANGYOU
I want to know the innodb_stats_persistent option in your server I check the code it only happens in innodb_stats_persistent=off But my server meet full scan in innodb_stats_persistent=on and no online ddl