package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

# Functions

ConstructExtremesHistogram returns a histogram that are two equi-depth histograms stitched together that are each generated by equiDepthHistogramWithoutAdjustment.
DecodeHistogramBuckets decodes encoded HistogramData in tabStat and writes the resulting buckets into tabStat.Histogram.
DecodeUpperBound decodes the upper-bound of a histogram bucket into a datum.
DeleteOldStatsForColumns deletes old statistics from the system.table_statistics table.
DeleteOldStatsForOtherColumns deletes statistics from the system.table_statistics table for columns *not* in the given set of column IDs that are older than keepTime.
DisallowedOnSystemTable returns true if this tableID belongs to a special system table on which we want to disallow stats collection and stats usage.
EncodeUpperBound encodes the upper-bound datum of a histogram bucket.
EquiDepthHistogram creates a histogram where each bucket contains roughly the same number of samples (though it can vary when a boundary value has high frequency).
ForecastTableStatistics produces zero or more statistics forecasts based on the given observed statistics.
GetDefaultHistogramBuckets gets the default number of histogram buckets to create for the given table.
InsertNewStat inserts a new statistic in the system table.
InsertNewStats inserts a slice of statistics at the current time into the system table.
MakeRefresher creates a new Refresher.
MakeSortedColStatKey constructs a unique key representing cols that can be used as the key in a map, and also sorts cols as a side-effect.
MergedStatistics returns an array of table statistics that are the merged combinations of the latest full statistic and the latest partial statistic for a specific column set.
NewTableStatisticProto converts a row of datums from system.table_statistics into a TableStatisticsProto.
NewTableStatisticsCache creates a new TableStatisticsCache that can hold statistics for <cacheSize> tables.
TSFromString creates a TS from a string.
TSFromTime creates a TS from a time.Time.

# Constants

HistVersion is the current histogram version.

# Variables

AutomaticPartialStatisticsClusterMode controls the cluster setting for enabling automatic table partial statistics collection.
AutomaticPartialStatisticsFractionStaleRows controls the cluster setting for the target fraction of rows in a table that should be stale before partial statistics on that table are refreshed, in addition to the constant value AutomaticPartialStatisticsMinStaleRows.
AutomaticPartialStatisticsMinStaleRows controls the cluster setting for the target number of rows that should be updated before a table is refreshed, in addition to the fraction AutomaticStatisticsFractionStaleRows.
AutomaticStatisticsClusterMode controls the cluster setting for enabling automatic table statistics collection.
AutomaticStatisticsFractionStaleRows controls the cluster setting for the target fraction of rows in a table that should be stale before statistics on that table are refreshed, in addition to the constant value AutomaticStatisticsMinStaleRows.
AutomaticStatisticsMaxIdleTime controls the maximum fraction of time that the sampler processors will be idle when scanning large tables for automatic statistics (in high load scenarios).
AutomaticStatisticsMinStaleRows controls the cluster setting for the target number of rows that should be updated before a table is refreshed, in addition to the fraction AutomaticStatisticsFractionStaleRows.
AutomaticStatisticsOnSystemTables controls the cluster setting for enabling automatic statistics collection on system tables.
ConcurrentCreateStatsError is reported when two CREATE STATISTICS jobs are issued concurrently.
DefaultAsOfTime is a duration which is used to define the AS OF time for automatic runs of CREATE STATISTICS.
DefaultHistogramBuckets is the maximum number of histogram buckets to build when creating statistics.
DefaultRefreshInterval is the frequency at which the Refresher will check if the stats for each table should be refreshed.
HistogramClusterMode controls the cluster setting for enabling histogram collection.
HistogramMCVsClusterMode controls the cluster setting for enabling inclusion of the most common values as buckets in the histogram.
MaxFractionHistogramMCVs controls the cluster setting for the maximum fraction of buckets in a histogram to use for tracking most common values.
MultiColumnStatisticsClusterMode controls the cluster setting for enabling automatic collection of multi-column statistics.
RandDatum is randgen.RandDatum.
RandType is randgen.RandType.
TableStatisticsRetentionPeriod controls the cluster setting for the retention period of statistics that are not collected by default.
UseStatisticsForecasts controls whether statistics forecasts are generated in the stats cache.
UseStatisticsOnSystemTables controls the cluster setting for enabling statistics usage by the optimizer for planning queries involving system tables.

# Structs

JSONHistoBucket is a struct used for JSON marshaling and unmarshaling of histogram data.
JSONStatistic is a struct used for JSON marshaling and unmarshaling statistics.
MCV contains an index into a slice of samples, and the count of samples equal to the sample at idx.
Refresher is responsible for automatically refreshing the table statistics that are used by the cost-based optimizer.
SampledRow is a row that was sampled.
SampleReservoir implements reservoir sampling using random sort.
A TableStatistic object holds a statistic for a particular column or group of columns.
A TableStatisticsCache contains two underlying LRU caches: (1) A cache of []*TableStatistic objects, keyed by table ID.
TableStatsTestingKnobs contains testing knobs for table statistics.
TS represents a timestamp when stats were created.

# Type aliases

HistogramVersion identifies histogram versions.
An MCVHeap is used to track the most common values in a slice of samples.