P1-[4.0-bug-hunting]-[SQL Plan Management]-ANALYZE after bulk update unreliable #17802
Labels
duplicate
Issues or pull requests already exists.
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Bug Hunter issue tidb-challenge-program/bug-hunting-issue#20
Bug Report
This is a duplicate of #16570
I created the issue today before realising there is a challenge program!
1. What did you do?
After I bulk updated rows, I ran
ANALYZE TABLE
. TheANALYZE
did not take into account the recent update, and statistics remained out of date.This appears to be a race condition. Consider the following:
If you remove the
SLEEP(5)
you will get incorrect statistics.2. What did you expect to see?
With the sleep call:
3. What did you see instead?
Without the sleep call:
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: