Describe the problem
The backup code uses the stats cache to retrieve table statistics for backup.
|
tableStatisticsAcc, err := statsCache.GetTableStats(ctx, tableDesc) |
As a result, we only back up what the stats cache returns and it doesn't return partial statistics.
|
return fullStatsList, nil |
While it does return "merged" statistics which at least contains the estimates produce in those statistics, those will be excluded from the backup after #94992.
One option here is to stop using the stats cache for retrieving the statistics and instead create some new, more appropriate API.
Jira issue: CRDB-23298
Describe the problem
The backup code uses the stats cache to retrieve table statistics for backup.
cockroach/pkg/ccl/backupccl/backup_job.go
Line 357 in 5eb4574
As a result, we only back up what the stats cache returns and it doesn't return partial statistics.
cockroach/pkg/sql/stats/stats_cache.go
Line 823 in 5eb4574
While it does return "merged" statistics which at least contains the estimates produce in those statistics, those will be excluded from the backup after #94992.
One option here is to stop using the stats cache for retrieving the statistics and instead create some new, more appropriate API.
Jira issue: CRDB-23298