You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"level": "WARN",
"time": "2025/10/08 18:10:37.342 +00:00",
"caller": "stats_syncload.go:415",
"message": "fail to get hist meta for this histogram, possibly a deleted one",
"table_id": 1039,
"hist_id": 2,
"is_index": true
}
This happens for multiple table_id's and multiple hist_id's, but is_index is always true.
It looks like mysql.stats_histograms doesn't have an entry for the table_id/hist_id/is_index combination.
The message seems to repeat with the same properties.
set @@cte_max_recursion_depth=10000;
use test;
createtableh (idx int, code int, typ1 int, typ2 int, update_time int, key k1(idx, typ1, typ2), key k2(idx, update_time));
insert into h select*from (
with recursive tt as (
select0 idx, 0as code, 0as typ1, 0as typ2, 0as update_time
union allselect mod(update_time, 100) as idx, 0as code, 0as typ1, 0as typ2, update_time+1as update_time from tt where update_time<5000
) select*from tt
) tt;
Analyze the table and explain to check the stats status:
analyze table h;
explain select*from h where idx =0;
Add a new index:
ALTERTABLE h ADD INDEX k3(code);
explain select*from h where code =0;
Check logs:
[2025/10/14 12:49:01.140 +02:00] [WARN] [stats_syncload.go:416] ["fail to get hist meta for this histogram, possibly a deleted one"] [table_id=110] [hist_id=3] [is_index=true]
Reacted by Daniël van Eeden, Yuanjia Zhang and Arenatlx
On 8.5.2, I can confirm that the issue is from here:
The checked field is always false.
The reason the checked field is always false is that the lite init stats process never sets this field. Additionally, during the stats update process, there are no updates after the last histogram version, so the columns’ and indexes’ statistics are never checked. As a result, this field remains false.
Activity
0xPoe commentedon Oct 14, 2025
The reproduction step:
0xPoe commentedon Oct 14, 2025
I think we should make the error message clearer and use a sample logger to reduce the amount of logs.
0xPoe commentedon Oct 14, 2025
The load behavior is expected, but it’s just too overwhelming.There are some subtle differences between the master branch and 8.5.2. Further investigation is needed.
0xPoe commentedon Oct 16, 2025
On 8.5.2, I can confirm that the issue is from here:
The checked field is always false.
The reason the checked field is always false is that the lite init stats process never sets this field. Additionally, during the stats update process, there are no updates after the last histogram version, so the columns’ and indexes’ statistics are never checked. As a result, this field remains false.
dveeden commentedon Oct 16, 2025
What about v8.5.3, does that have the same issue?
0xPoe commentedon Oct 16, 2025
I have confirmed that this issue still exists even in the latest release-8.5 branch.
0xPoe commentedon Oct 16, 2025
For the master branch, I believe this issue still existed before we merged PR #63626.
statistics: use sampled logger and improve error messages (pingcap#63962
statistics: use sampled logger and improve error messages (pingcap#63962
planner: pick #64622 #63519 #63962 #64644 #64501 (#64689)
statistics: use sampled logger and improve error messages (#63962) (#…