util

package
v1.1.0-beta.0...-57a73ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TiDBGlobalStats represents the global-stats for a partitioned table.
	TiDBGlobalStats = "global"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONColumn

type JSONColumn struct {
	Histogram *tipb.Histogram `json:"histogram"`
	CMSketch  *tipb.CMSketch  `json:"cm_sketch"`
	FMSketch  *tipb.FMSketch  `json:"fm_sketch"`
	// StatsVer is a pointer here since the old version json file would not contain version information.
	StatsVer          *int64  `json:"stats_ver"`
	NullCount         int64   `json:"null_count"`
	TotColSize        int64   `json:"tot_col_size"`
	LastUpdateVersion uint64  `json:"last_update_version"`
	Correlation       float64 `json:"correlation"`
}

JSONColumn is used for dumping statistics.

func (*JSONColumn) TotalMemoryUsage

func (col *JSONColumn) TotalMemoryUsage() (size int64)

TotalMemoryUsage returns the total memory usage of this column.

type JSONExtendedStats

type JSONExtendedStats struct {
	StatsName  string  `json:"stats_name"`
	StringVals string  `json:"string_vals"`
	ColIDs     []int64 `json:"cols"`
	ScalarVals float64 `json:"scalar_vals"`
	Tp         uint8   `json:"type"`
}

JSONExtendedStats is used for dumping extended statistics.

type JSONPredicateColumn

type JSONPredicateColumn struct {
	LastUsedAt     *string `json:"last_used_at"`
	LastAnalyzedAt *string `json:"last_analyzed_at"`
	ID             int64   `json:"id"`
}

JSONPredicateColumn contains the information of the columns used in the predicate.

type JSONTable

type JSONTable struct {
	Columns           map[string]*JSONColumn `json:"columns"`
	Indices           map[string]*JSONColumn `json:"indices"`
	Partitions        map[string]*JSONTable  `json:"partitions"`
	DatabaseName      string                 `json:"database_name"`
	TableName         string                 `json:"table_name"`
	ExtStats          []*JSONExtendedStats   `json:"ext_stats"`
	PredicateColumns  []*JSONPredicateColumn `json:"predicate_columns"`
	Count             int64                  `json:"count"`
	ModifyCount       int64                  `json:"modify_count"`
	Version           uint64                 `json:"version"`
	IsHistoricalStats bool                   `json:"is_historical_stats"`
}

JSONTable is used for dumping statistics.

func (*JSONTable) Sort

func (j *JSONTable) Sort()

Sort is used to sort the object in the JSONTable. it is used for testing to avoid flaky test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL