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
142963: sql/stats: unset histogram buckets proto after decoding r=yuzefovich a=yuzefovich
**sql/stats,backup: adjust table stats handling in backup**
This commit introduces a new method to return the protos of table
statistics directly from the DB (i.e. it by-passes the table stats cache)
and uses this method in the backup code. The main motivation is that we
want to nil out the histogram buckets in the proto that we store in the
table stats cache since we don't need them outside of the backup.
The new method hardens the logic of excluding merged and forecast stats
from the backup because we simply no longer include these stats into
what backups includes (because they are generated on demand rather than
read from the system table). It additionally ignores whether "stats
usage is allowed" on a particular table since it seems beneficial to
backup stats for all requested tables, and then once stats are restored
we can decide whether to actually use them.
Notable change for the new `GetTableStatsProtosFromDB` method is that we
no longer hydrate the column type nor decode upper bounds since this isn't
needed for the backup use case.
**stats: unset histogram buckets proto after decoding**
I think it should be safe to unset `HistogramData.Buckets` proto after
having decoded the histogram buckets since we only use `cat.HistogramBucket`
with decoded datums going forward (the only exception was the backup use
case, but it was adjusted in the previous commit to have a separate code
path). I noticed the proto was showing up noticeably in the inuse-space
heap profiles on a customer cluster.
It also adds a comment for why we're use `*bool` as `forecast` argument
in `getTableStatsFromCache`, as opposed to just `bool`.
Epic: None
Release note: None
Co-authored-by: Yahor Yuzefovich <[email protected]>
0 commit comments