Versions in this module Expand all Collapse all v0 v0.8.1 Oct 23, 2018 v0.8.0 Oct 19, 2018 Changes in this version + const ExtendedExplainType + const IndexColumnName + const IndexIndexType + const IndexKeyName + const IndexNonUnique + const JSONFormatExplain + const PartitionsExplainType + const TraditionalExplainType + const TraditionalFormatExplain + var ExplainAccessType = map[string]string + var ExplainColumnIndent = map[string]string + var ExplainExtra = map[string]string + var ExplainFormatType = map[string]int + var ExplainKeyWords = []string + var ExplainScalability = map[string]string + var ExplainSelectType = map[string]string + var ExplainType = map[string]int + func ExplainInfoTranslator(exp *ExplainInfo) string + func FormatProfiling(res *QueryResult) string + func FormatTrace(res *QueryResult) string + func MySQLExplainQueryCost(exp *ExplainInfo) string + func MySQLExplainWarnings(exp *ExplainInfo) string + func PrintMarkdownExplainTable(exp *ExplainInfo) string + func RemoveSQLComments(sql []byte) []byte + type Connector struct + Addr string + Charset string + Database string + Pass string + User string + func (db *Connector) ColumnCardinality(tb, col string) float64 + func (db *Connector) Explain(sql string, explainType int, formatType int) (exp *ExplainInfo, err error) + func (db *Connector) FindColumn(name, dbName string, tables ...string) ([]*common.Column, error) + func (db *Connector) IsFKey(dbName, tbName, column string) bool + func (db *Connector) IsView(tbName string) bool + func (db *Connector) NewConnection() mysql.Conn + func (db *Connector) Profiling(sql string, params ...interface{}) (*QueryResult, error) + func (db *Connector) Query(sql string, params ...interface{}) (*QueryResult, error) + func (db *Connector) SamplingData(remote Connector, tables ...string) error + func (db *Connector) ShowColumns(tableName string) (*TableDesc, error) + func (db *Connector) ShowCreateDatabase(dbName string) (string, error) + func (db *Connector) ShowCreateTable(tableName string) (string, error) + func (db *Connector) ShowIndex(tableName string) (*TableIndexInfo, error) + func (db *Connector) ShowReference(dbName string, tbName ...string) ([]ReferenceValue, error) + func (db *Connector) ShowTableStatus(tableName string) (*TableStatInfo, error) + func (db *Connector) ShowTables() ([]string, error) + func (db *Connector) SingleIntValue(option string) (int, error) + func (db *Connector) Source(file string) ([]*QueryResult, error) + func (db *Connector) Trace(sql string, params ...interface{}) (*QueryResult, error) + func (db *Connector) Version() (int, error) + type ExplainInfo struct + ExplainFormat int + ExplainJSON *ExplainJSON + ExplainRows []*ExplainRow + QueryCost float64 + SQL string + Warnings []*ExplainWarning + func ParseExplainResult(res *QueryResult, formatType int) (exp *ExplainInfo, err error) + func ParseExplainText(content string) (exp *ExplainInfo, err error) + type ExplainJSON struct + QueryBlock ExplainJSONQueryBlock + type ExplainJSONBufferResult struct + NestedLoop []ExplainJSONNestedLoop + UsingTemporaryTable bool + type ExplainJSONCostInfo struct + DataReadPerJoin string + EvalCost string + PrefixCost string + QueryCost string + ReadCost string + SortCost string + type ExplainJSONDuplicatesRemoval struct + BufferResult ExplainJSONBufferResult + GroupingOperation ExplainJSONGroupingOperation + UsingFilesort bool + UsingTemporaryTable bool + type ExplainJSONGroupingOperation struct + CostInfo ExplainJSONCostInfo + GroupBySubqueries []ExplainJSONSubqueries + NestedLoop []ExplainJSONNestedLoop + Table ExplainJSONTable + UsingFilesort bool + UsingTemporaryTable bool + type ExplainJSONMaterializedFromSubquery struct + Cacheable bool + Dependent bool + QueryBlock *ExplainJSONQueryBlock + UsingTemporaryTable bool + type ExplainJSONNestedLoop struct + Table ExplainJSONTable + type ExplainJSONOrderingOperation struct + DuplicatesRemoval ExplainJSONDuplicatesRemoval + GroupingOperation ExplainJSONGroupingOperation + OderbySubqueries []ExplainJSONSubqueries + Table ExplainJSONTable + UsingFilesort bool + type ExplainJSONQueryBlock struct + CostInfo ExplainJSONCostInfo + GroupingOperation ExplainJSONGroupingOperation + HavingSubqueries []ExplainJSONSubqueries + Message string + NestedLoop []ExplainJSONNestedLoop + OptimizedAwaySubqueries []ExplainJSONSubqueries + OrderingOperation ExplainJSONOrderingOperation + QuerySpecifications []ExplainJSONSubqueries + SelectID int + SelectListSubqueries []ExplainJSONSubqueries + Table ExplainJSONTable + UnionResult ExplainJSONUnionResult + UpdateValueSubqueries []ExplainJSONSubqueries + type ExplainJSONSubqueries struct + Cacheable bool + Dependent bool + QueryBlock ExplainJSONQueryBlock + type ExplainJSONTable struct + AccessType string + AttachedCondition string + AttachedSubqueries []ExplainJSONSubqueries + CostInfo ExplainJSONCostInfo + Filtered string + Key string + KeyLength string + MaterializedFromSubquery ExplainJSONMaterializedFromSubquery + PossibleKeys []string + Ref []string + RowsExaminedPerScan int + RowsProducedPerJoin int + TableName string + UsedColumns []string + UsedKeyParts []string + UsingIndex bool + UsingIndexForGroupBy bool + type ExplainJSONUnionResult struct + AccessType string + QuerySpecifications []ExplainJSONSubqueries + TableName string + UsingTemporaryTable bool + type ExplainRow struct + AccessType string + Extra string + Filtered float64 + ID int + Key string + KeyLen string + Partitions string + PossibleKeys []string + Ref []string + Rows int + Scalability string + SelectType string + TableName string + func ConvertExplainJSON2Row(explainJSON *ExplainJSON) []*ExplainRow + func FormatJSONIntoTraditional(explainJSON string) []*ExplainRow + type ExplainWarning struct + Code int + Level string + Message string + type IndexSelectKey string + type Profiling struct + Rows []ProfilingRow + type ProfilingRow struct + Duration float64 + Status string + type QueryResult struct + Error error + QueryCost float64 + Result mysql.Result + Rows []mysql.Row + Warning []mysql.Row + type Reference map[string][]ReferenceValue + type ReferenceValue struct + ConstraintName string + DBName string + RefDBName string + RefTable string + Table string + type TableDesc struct + DescValues []TableDescValue + Name string + func NewTableDesc(tableName string) *TableDesc + func (td TableDesc) Columns() []string + type TableDescValue struct + Collation string + Comment string + Default string + Extra string + Field string + Key string + Null string + Privileges string + Type string + type TableIndexInfo struct + IdxRows []TableIndexRow + TableName string + func NewTableIndexInfo(tableName string) *TableIndexInfo + func (tbIndex *TableIndexInfo) FindIndex(arg IndexSelectKey, value string) []TableIndexRow + type TableIndexRow struct + Cardinality int + Collation string + ColumnName string + Comment string + IndexComment string + IndexType string + KeyName string + NonUnique int + Null string + Packed int + SeqInIndex int + SubPart int + Table string + type TableStatInfo struct + Name string + Rows []tableStatusRow + type Trace struct + Rows []TraceRow + type TraceRow struct + InsufficientPrivileges int + MissingBytesBeyondMaxMemSize int + Query string + Trace string