Versions in this module Expand all Collapse all v0 v0.18.1 Apr 9, 2024 Changes in this version + func GetNewCounts(buckets []sql.HistogramBucket) (rowCount uint64, distinctCount uint64, nullCount uint64) + func NewStatsIter(ctx *sql.Context, dStats ...sql.Statistic) (*statsIter, error) + func ParseRow(rowStr string, types []sql.Type) (sql.Row, error) + func StringifyKey(r sql.Row, types []sql.Type) string type Statistic + Colset sql.ColSet + Fds *sql.FuncDepSet + type StatisticJSON struct + AvgRowSize uint64 + Cols []string + Colset sql.ColSet + Created time.Time + DistinctCnt uint64 + Fds *sql.FuncDepSet + Hist []*Bucket + IdxClass uint8 + LowerBnd sql.Row + NullCnt uint64 + Qual sql.StatQualifier + RowCnt uint64 + Typs []sql.Type + func (j *StatisticJSON) ToStatistic() *Statistic v0.18.0 Feb 28, 2024 Changes in this version + var ErrJoinStringStatistics = errors.New("joining string histograms is unsupported") + func AlignBuckets(h1, h2 sql.Histogram, lBound1, lBound2 sql.Row, s1Types, s2Types []sql.Type, ...) (sql.Histogram, sql.Histogram, error) + func Empty(s sql.Statistic) bool + func IndexFds(tableName string, sch sql.Schema, idx sql.Index) (*sql.FuncDepSet, sql.ColSet, error) + func InterpolateNewCounts(from, to sql.Statistic) sql.Statistic + func Intersect(s1, s2 sql.Statistic) sql.Statistic + func Join(s1, s2 sql.Statistic, prefixCnt int, debug bool) (sql.Statistic, error) + func McvPrefixGt(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func McvPrefixGte(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func McvPrefixIsNotNull(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func McvPrefixIsNull(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func McvPrefixLt(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func McvPrefixLte(statistic sql.Statistic, i int, val interface{}) (sql.Statistic, error) + func NewExpDistIter(colCnt, rowCnt int, lambda float64) sql.RowIter + func NewNormDistIter(colCnt, rowCnt int, mean, std float64) sql.RowIter + func ParseTypeStrings(typs []string) ([]sql.Type, error) + func PrefixGt(statistic sql.Statistic, val interface{}) (sql.Statistic, error) + func PrefixGtHist(h sql.Histogram, target sql.Row, cmp func(sql.Row, sql.Row) (int, error)) (int, error) + func PrefixGte(statistic sql.Statistic, val interface{}) (sql.Statistic, error) + func PrefixGteHist(h sql.Histogram, target sql.Row, cmp func(sql.Row, sql.Row) (int, error)) (int, error) + func PrefixIsNotNull(statistic sql.Statistic) (sql.Statistic, error) + func PrefixIsNull(statistic sql.Statistic) (sql.Statistic, error) + func PrefixKey(statistic sql.Statistic, key []interface{}, nullable []bool) (sql.Statistic, error) + func PrefixLt(statistic sql.Statistic, val interface{}) (sql.Statistic, error) + func PrefixLtHist(h sql.Histogram, target sql.Row, cmp func(sql.Row, sql.Row) (int, error)) (int, error) + func PrefixLte(statistic sql.Statistic, val interface{}) (sql.Statistic, error) + func PrefixLteHist(h sql.Histogram, target sql.Row, cmp func(sql.Row, sql.Row) (int, error)) (int, error) + func Union(s1, s2 sql.Statistic) sql.Statistic + func UpdateCounts(statistic sql.Statistic) sql.Statistic + type Bucket struct + BoundCnt uint64 + BoundVal sql.Row + DistinctCnt uint64 + McvVals []sql.Row + McvsCnt []uint64 + NullCnt uint64 + RowCnt uint64 + func NewHistogramBucket(rowCount, distinctCount, nullCount, boundCount uint64, boundValue sql.Row, ...) *Bucket + func (b Bucket) BoundCount() uint64 + func (b Bucket) DistinctCount() uint64 + func (b Bucket) McvCounts() []uint64 + func (b Bucket) Mcvs() []sql.Row + func (b Bucket) NullCount() uint64 + func (b Bucket) RowCount() uint64 + func (b Bucket) UpperBound() sql.Row + type HeapRow struct + Count int + Row sql.Row + func NewHeapRow(r sql.Row, cnt int) HeapRow + type SqlHeap struct + func NewSqlHeap(k int) *SqlHeap + func (h *SqlHeap) Pop() any + func (h *SqlHeap) Push(x any) + func (h SqlHeap) Array() []sql.Row + func (h SqlHeap) Counts() []uint64 + func (h SqlHeap) Len() int + func (h SqlHeap) Less(i, j int) bool + func (h SqlHeap) Swap(i, j int) + type Statistic struct + AvgRowSize uint64 + Cols []string + Created time.Time + DistinctCnt uint64 + Hist []*Bucket + IdxClass uint8 + LowerBnd sql.Row + NullCnt uint64 + Qual sql.StatQualifier + RowCnt uint64 + Typs []sql.Type + func NewStatistic(rowCount, distinctCount, nullCount, avgSize uint64, createdAt time.Time, ...) *Statistic + func (s *Statistic) AvgSize() uint64 + func (s *Statistic) ColSet() sql.ColSet + func (s *Statistic) Columns() []string + func (s *Statistic) CreatedAt() time.Time + func (s *Statistic) DistinctCount() uint64 + func (s *Statistic) FuncDeps() *sql.FuncDepSet + func (s *Statistic) Histogram() sql.Histogram + func (s *Statistic) IndexClass() sql.IndexClass + func (s *Statistic) LowerBound() sql.Row + func (s *Statistic) NullCount() uint64 + func (s *Statistic) Qualifier() sql.StatQualifier + func (s *Statistic) RowCount() uint64 + func (s *Statistic) SetColumns(c []string) + func (s *Statistic) SetQualifier(q sql.StatQualifier) + func (s *Statistic) SetTypes(t []sql.Type) + func (s *Statistic) ToInterface() interface{} + func (s *Statistic) Types() []sql.Type + func (s *Statistic) WithAvgSize(i uint64) sql.Statistic + func (s *Statistic) WithColSet(cols sql.ColSet) sql.Statistic + func (s *Statistic) WithDistinctCount(i uint64) sql.Statistic + func (s *Statistic) WithFuncDeps(fds *sql.FuncDepSet) sql.Statistic + func (s *Statistic) WithHistogram(h sql.Histogram) (sql.Statistic, error) + func (s *Statistic) WithLowerBound(r sql.Row) sql.Statistic + func (s *Statistic) WithNullCount(i uint64) sql.Statistic + func (s *Statistic) WithRowCount(i uint64) sql.Statistic