Skip to content

Commit

Permalink
statistics: fix entry too large when to save historical stats (#47653)
Browse files Browse the repository at this point in the history
close #47649
  • Loading branch information
hawkingrei authored Oct 16, 2023
1 parent f4f8cd6 commit 541ac59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/statistics/handle/history/history_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func RecordHistoricalStatsMeta(sctx sessionctx.Context, tableID int64, version u
}

// Max column size is 6MB. Refer https://docs.pingcap.com/tidb/dev/tidb-limitations/#limitation-on-a-single-column
const maxColumnSize = 6 << 20
// but here is less than 6MB, because stats_history has other info except stats_data.
const maxColumnSize = 5 << 20

// RecordHistoricalStatsToStorage records the given table's stats data to mysql.stats_history
func RecordHistoricalStatsToStorage(sctx sessionctx.Context, physicalID int64, js *storage.JSONTable) (uint64, error) {
Expand Down

0 comments on commit 541ac59

Please sign in to comment.