Documentation ¶
Overview ¶
Package statistics is a generated protocol buffer package.
It is generated from these files:
statistics.proto
It has these top-level messages:
ColumnPB TablePB
Index ¶
- type Column
- type ColumnPB
- func (*ColumnPB) Descriptor() ([]byte, []int)
- func (m *ColumnPB) GetId() int64
- func (m *ColumnPB) GetNdv() int64
- func (m *ColumnPB) GetNumbers() []int64
- func (m *ColumnPB) GetRepeats() []int64
- func (m *ColumnPB) GetValue() []byte
- func (*ColumnPB) ProtoMessage()
- func (m *ColumnPB) Reset()
- func (m *ColumnPB) String() string
- type Table
- type TablePB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { ID int64 // Column ID. NDV int64 // Number of distinct values. // Histogram elements. // // A bucket number is the number of items stored in all previous buckets and the current bucket. // bucket numbers are always in increasing order. // // A bucket value is the greatest item value stored in the bucket. // // Repeat is the number of repeats of the bucket value, it can be used to find popular values. // // We could have make a bucket struct contains number, value and repeat, but that would be harder to // serialize, so we store every bucket field in its own slice instead. those slices all have // the bucket count length. Numbers []int64 Values []types.Datum Repeats []int64 }
Column represents statistics for a column.
func (*Column) BetweenRowCount ¶
BetweenRowCount estimates the row count where column greater or equal to a and less than b.
func (*Column) EqualRowCount ¶
EqualRowCount estimates the row count where the column equals to value.
func (*Column) LessRowCount ¶
LessRowCount estimates the row count where the column less than value.
type ColumnPB ¶
type ColumnPB struct { Id *int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Ndv *int64 `protobuf:"varint,2,opt,name=ndv" json:"ndv,omitempty"` Numbers []int64 `protobuf:"varint,3,rep,name=numbers" json:"numbers,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` Repeats []int64 `protobuf:"varint,5,rep,name=repeats" json:"repeats,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*ColumnPB) Descriptor ¶
func (*ColumnPB) GetNumbers ¶
func (*ColumnPB) GetRepeats ¶
func (*ColumnPB) ProtoMessage ¶
func (*ColumnPB) ProtoMessage()
type Table ¶
type Table struct { TS int64 // build timestamp. Columns []*Column Count int64 // Total row count in a table. // contains filtered or unexported fields }
Table represents statistics for a table.
func NewTable ¶
func NewTable(ti *model.TableInfo, ts, count, numBuckets int64, columnSamples [][]types.Datum) (*Table, error)
NewTable creates a table statistics.
func PseudoTable ¶
PseudoTable creates a pseudo table statistics when statistic can not be found in KV store.
func TableFromPB ¶
TableFromPB creates a table statistics from protobuffer.
type TablePB ¶
type TablePB struct { Id *int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Ts *int64 `protobuf:"varint,2,opt,name=ts" json:"ts,omitempty"` Count *int64 `protobuf:"varint,3,opt,name=count" json:"count,omitempty"` Columns []*ColumnPB `protobuf:"bytes,4,rep,name=columns" json:"columns,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*TablePB) Descriptor ¶
func (*TablePB) GetColumns ¶
func (*TablePB) ProtoMessage ¶
func (*TablePB) ProtoMessage()