Documentation
¶
Index ¶
- Constants
- type Index
- type Table
- func (ta *Table) AddColumn(name string, columnType querypb.Type, defval sqltypes.Value, extra string)
- func (ta *Table) AddIndex(name string) (index *Index)
- func (ta *Table) FindColumn(name string) int
- func (ta *Table) GetPKColumn(index int) *TableColumn
- func (ta *Table) IsCached() bool
- func (ta *Table) IsReadCached() bool
- func (ta *Table) SetMysqlStats(tr, dl, il, df sqltypes.Value)
- type TableColumn
Constants ¶
const ( CacheNone = 0 CacheRW = 1 CacheW = 2 Sequence = 3 )
Cache types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
Name string
// Columns are the columns comprising the index.
Columns []string
// Cardinality[i] is the number of distinct values of Columns[i] in the
// table.
Cardinality []uint64
// DataColumns are the primary-key columns for secondary indices and
// all the columns for the primary-key index.
DataColumns []string
}
Index contains info about a table index.
func (*Index) FindColumn ¶
FindColumn finds a column in the index. It returns the index if found. Otherwise, it returns -1.
func (*Index) FindDataColumn ¶
FindDataColumn finds a data column in the index. It returns the index if found. Otherwise, it returns -1.
type Table ¶
type Table struct {
Name string
Columns []TableColumn
Indexes []*Index
PKColumns []int
Type int
// These vars can be accessed concurrently.
TableRows sync2.AtomicInt64
DataLength sync2.AtomicInt64
IndexLength sync2.AtomicInt64
DataFree sync2.AtomicInt64
}
Table contains info about a table.
func (*Table) AddColumn ¶
func (ta *Table) AddColumn(name string, columnType querypb.Type, defval sqltypes.Value, extra string)
AddColumn adds a column to the Table.
func (*Table) FindColumn ¶
FindColumn finds a column in the table. It returns the index if found. Otherwise, it returns -1.
func (*Table) GetPKColumn ¶
func (ta *Table) GetPKColumn(index int) *TableColumn
GetPKColumn returns the pk column specified by the index.
func (*Table) IsReadCached ¶
IsReadCached returns true if the rowcache can be used for reads. TODO(sougou): remove after deprecating schema overrides.
func (*Table) SetMysqlStats ¶
SetMysqlStats receives the values found in the mysql information_schema.tables table