-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql,backupccl: partial stats are not included in backup #95056
Copy link
Copy link
Closed
Labels
A-disaster-recoveryA-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-disaster-recovery
Description
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
| 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.
cockroach/pkg/sql/stats/stats_cache.go
Line 823 in 5eb4574
| 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-disaster-recoveryA-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-disaster-recovery
Type
Projects
Status
Done