Documentation
¶
Index ¶
- Constants
- Variables
- func BuildJsonPlan(ctx context.Context, uuid uuid.UUID, options *ExplainOptions, ...) *models.ExplainData
- func ConvertNode(ctx context.Context, node *plan.Node, options *ExplainOptions) (*models.Node, error)
- func DebugPlan(pl *plan.Plan) string
- func GetDeleteTableLabelValue(deleteCtx *plan.DeleteCtx) []string
- func GetExprsLabelValue(ctx context.Context, exprList []*plan.Expr, options *ExplainOptions) ([]string, error)
- func GetInputRowsAndInputSize(ctx context.Context, node *plan.Node, options *ExplainOptions) (rows int64, size int64)
- func GetOrderByLabelValue(ctx context.Context, orderbyList []*plan.OrderBySpec, options *ExplainOptions) ([]string, error)
- func GetStatistic4Trace(ctx context.Context, node *plan.Node, options *ExplainOptions) (s statistic.StatsArray)
- func GetTableColsLableValue(ctx context.Context, cols []*plan.ColDef, options *ExplainOptions) []string
- func PreOrderPlan(ctx context.Context, node *plan.Node, Nodes []*plan.Node, ...) error
- type AnalyzeInfoDescribeImpl
- type CostDescribeImpl
- type ExplainDataBuffer
- type ExplainFormat
- type ExplainOptions
- type ExplainQuery
- type ExplainQueryImpl
- type ExprListDescribeImpl
- type FormatSettings
- type MarshalNode
- type MarshalNodeImpl
- func (m MarshalNodeImpl) GetNodeLabels(ctx context.Context, options *ExplainOptions) ([]models.Label, error)
- func (m MarshalNodeImpl) GetNodeName(ctx context.Context) (string, error)
- func (m MarshalNodeImpl) GetNodeTitle(ctx context.Context, options *ExplainOptions) (string, error)
- func (m MarshalNodeImpl) GetStatistics(ctx context.Context, options *ExplainOptions) models.Statistics
- func (m MarshalNodeImpl) GetStats() models.Stats
- func (m MarshalNodeImpl) GetTotalStats() models.TotalStats
- type NodeDescribe
- type NodeDescribeImpl
- func (ndesc *NodeDescribeImpl) GetActualAnalyzeInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetAggregationInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetBlockFilterConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetDedupJoinCtxInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
- func (ndesc *NodeDescribeImpl) GetExtraInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
- func (ndesc *NodeDescribeImpl) GetFillColsInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetFillModeInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetFilterConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetFullTextSql(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetGroupByInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetIndexReaderParamInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetJoinConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetJoinTypeInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetNodeBasicInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetOrderByInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetProjectListInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetRecvMessageInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetRuntimeFilteProbeInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetRuntimeFilterBuildInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetSampleFuncInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetSendMessageInfo(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetTableDef(ctx context.Context, options *ExplainOptions) (string, error)
- func (ndesc *NodeDescribeImpl) GetUpdateCtxInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
- func (ndesc *NodeDescribeImpl) GetWindowSpectListInfo(ctx context.Context, options *ExplainOptions) (string, error)
- type NodeElemDescribe
- type OrderByDescribeImpl
- type RowsetDataDescribeImpl
- type WinSpecDescribeImpl
Constants ¶
const ( Label_Table_Name = "Full table name" Label_Table_Columns = "Columns" Label_Total_Columns = "Total columns" Label_Scan_Columns = "Scan columns" Label_List_Expression = "List of expressions" Label_Grouping_Keys = "Grouping keys" Label_Agg_Functions = "Aggregate functions" Label_Filter_Conditions = "Filter conditions" Label_Block_Filter_Conditions = "Block Filter conditions" Label_Join_Type = "Join type" Label_Join_Conditions = "Join conditions" Label_Left_NodeId = "Left node id" Label_Right_NodeId = "Right node id" Label_Sort_Keys = "Sort keys" Label_List_Values = "List of values" Label_Union_Expressions = "Union expressions" Label_Union_All_Expressions = "Union all expressions" Label_Intersect_Expressions = "Intersect expressions" Label_Intersect_All_Expressions = "Intersect all expressions" Label_Minus_Expressions = "Minus expressions" Label_Pre_Insert = "Pre insert" Label_Pre_InsertUk = "Pre insert uk" Label_Pre_InsertSk = "Pre insert sk" Label_Pre_Delete = "Pre delete" Label_Sink = "Sink" Label_Sink_Scan = "Sink scan" Label_Recursive_SCAN = "Recursive scan" Label_Recursive_CTE = "CTE scan" Label_Lock_Op = "Lock op" Label_Row_Number = "Number of rows" Label_Offset = "Offset" Label_Time_Window = "Time window" Label_Partition = "Partition" Label_Fill = "Fill" Label_Boardcast = "Boardcast" Label_Split = "Split" Label_Gather = "Gather" Label_Assert = "Assert" Label_Fuzzy_Filter = "Fuzzy filter" Label_External_Function = "External Function" Label_Distinct = "Distinct" Label_Sample = "Sample" Label_Window = "Window" Label_Minus_All = "Minus All" Label_Unique = "Unique" Label_Unknown = "Unknown" Label_Material = "Material" Label_Dedup_Join = "Dedup join" Label_Apply = "Apply" Label_PostDml = "PostDml" Label_Table_Clone = "Table Clone" )
const ( Statistic_Unit_ns = "ns" Statistic_Unit_count = "count" Statistic_Unit_byte = "byte" )
const DiskIO = "Disk IO"
const DiskReadSize = "Disk Read Size"
const ExternalScan = "External Scan"
const FSCacheDiskHit = "FileService Cache Disk Hit"
const FSCacheDiskRead = "FileService Cache Disk Read"
const FSCacheHit = "FileService Cache Hit"
const FSCacheMemoryHit = "FileService Cache Memory Hit"
const FSCacheMemoryRead = "FileService Cache Memory Read"
const FSCacheRead = "FileService Cache Read"
const FSCacheRemoteHit = "FileService Cache Remote Hit"
const FSCacheRemoteRead = "FileService Cache Remote Read"
const GB = MB * 1024
const IndexTableScan = "Index Table Scan"
const InputRows = "Input Rows"
const InputSize = "Input Size"
const InsertTime = "Insert Time"
const MB = 1024 * 1024
const MILLION = 1000000
const MemorySize = "Memory Size"
const Network = "Network"
const OutputRows = "Output Rows"
const OutputSize = "Output Size"
const ReadSize = "Read Size"
const S3Delete = "S3 Delete Count"
const S3DeleteMul = "S3 DeleteMul Count"
const S3Get = "S3 Get Count"
const S3Head = "S3 Head Count"
const S3List = "S3 List Count"
const S3Put = "S3 Put Count"
const S3ReadSize = "S3 Read Size"
const ScanBytes = "Scan Bytes"
const ScanTime = "Scan Time"
const TableScan = "Table Scan"
const TimeConsumed = "Time Consumed"
const WaitLockTime = "Wait Lock Time"
const WaitTime = "Wait Time"
Variables ¶
var MarshalPlanOptions = ExplainOptions{ Verbose: true, Analyze: true, Format: EXPLAIN_FORMAT_TEXT, }
The global variable is used to serialize plan and avoid objects being repeatedly created
Functions ¶
func BuildJsonPlan ¶ added in v0.8.0
func BuildJsonPlan(ctx context.Context, uuid uuid.UUID, options *ExplainOptions, query *plan.Query) *models.ExplainData
func ConvertNode ¶ added in v0.6.0
func GetDeleteTableLabelValue ¶ added in v0.8.0
func GetExprsLabelValue ¶ added in v0.6.0
func GetInputRowsAndInputSize ¶ added in v1.0.0
func GetInputRowsAndInputSize(ctx context.Context, node *plan.Node, options *ExplainOptions) (rows int64, size int64)
GetInputRowsAndInputSize return plan.Node AnalyzeInfo InputRows and InputSize. The method only records the original table's input data, and does not record index table's input data migrate ExplainData.StatisticsRead to here
func GetOrderByLabelValue ¶ added in v0.8.0
func GetOrderByLabelValue(ctx context.Context, orderbyList []*plan.OrderBySpec, options *ExplainOptions) ([]string, error)
func GetStatistic4Trace ¶ added in v1.0.0
func GetStatistic4Trace(ctx context.Context, node *plan.Node, options *ExplainOptions) (s statistic.StatsArray)
func GetTableColsLableValue ¶ added in v0.6.0
Types ¶
type AnalyzeInfoDescribeImpl ¶ added in v0.6.0
type AnalyzeInfoDescribeImpl struct {
AnalyzeInfo *plan.AnalyzeInfo
}
func NewAnalyzeInfoDescribeImpl ¶ added in v0.6.0
func NewAnalyzeInfoDescribeImpl(analyze *plan.AnalyzeInfo) *AnalyzeInfoDescribeImpl
func (AnalyzeInfoDescribeImpl) GetDescription ¶ added in v0.6.0
func (a AnalyzeInfoDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error
type CostDescribeImpl ¶
func (*CostDescribeImpl) GetDescription ¶
func (c *CostDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error
type ExplainDataBuffer ¶
func NewExplainDataBuffer ¶
func NewExplainDataBuffer() *ExplainDataBuffer
func (*ExplainDataBuffer) AppendCurrentLine ¶
func (buf *ExplainDataBuffer) AppendCurrentLine(temp string)
func (*ExplainDataBuffer) PushNewLine ¶
func (buf *ExplainDataBuffer) PushNewLine(line string, isNewNode bool, level int)
func (*ExplainDataBuffer) PushPlanTitle ¶ added in v0.8.0
func (buf *ExplainDataBuffer) PushPlanTitle(title string)
func (*ExplainDataBuffer) ToString ¶ added in v1.0.0
func (buf *ExplainDataBuffer) ToString() string
type ExplainFormat ¶
type ExplainFormat int32
const ( EXPLAIN_FORMAT_TEXT ExplainFormat = 0 EXPLAIN_FORMAT_XML ExplainFormat = 1 EXPLAIN_FORMAT_JSON ExplainFormat = 2 EXPLAIN_FORMAT_DOT ExplainFormat = 3 )
type ExplainOptions ¶
type ExplainOptions struct {
Verbose bool
Analyze bool
Format ExplainFormat
NodeType plan.Node_NodeType
CheckExpr []string
}
func NewExplainDefaultOptions ¶
func NewExplainDefaultOptions() *ExplainOptions
type ExplainQuery ¶
type ExplainQuery interface {
ExplainPlan(ctx context.Context, buffer *ExplainDataBuffer, options *ExplainOptions) error
}
type ExplainQueryImpl ¶
func NewExplainQueryImpl ¶
func NewExplainQueryImpl(query *plan.Query) *ExplainQueryImpl
func (*ExplainQueryImpl) ExplainPlan ¶
func (e *ExplainQueryImpl) ExplainPlan(ctx context.Context, buffer *ExplainDataBuffer, options *ExplainOptions) error
type ExprListDescribeImpl ¶
type ExprListDescribeImpl struct {
ExprList []*plan.Expr // ProjectList,OnList,FilterList,GroupBy,GroupingSet and so on
}
func NewExprListDescribeImpl ¶
func NewExprListDescribeImpl(ExprList []*plan.Expr) *ExprListDescribeImpl
func (*ExprListDescribeImpl) GetDescription ¶
func (e *ExprListDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error
type FormatSettings ¶
type FormatSettings struct {
// contains filtered or unexported fields
}
type MarshalNode ¶ added in v0.6.0
type MarshalNode interface {
GetNodeName(ctx context.Context) (string, error)
GetNodeTitle(ctx context.Context, options *ExplainOptions) (string, error)
GetNodeLabels(ctx context.Context, options *ExplainOptions) ([]models.Label, error)
GetStatistics(ctx context.Context, options *ExplainOptions) models.Statistics
GetStats() models.Stats
GetTotalStats() models.TotalStats
}
type MarshalNodeImpl ¶ added in v0.6.0
type MarshalNodeImpl struct {
// contains filtered or unexported fields
}
func NewMarshalNodeImpl ¶ added in v0.6.0
func NewMarshalNodeImpl(node *plan.Node) *MarshalNodeImpl
func (MarshalNodeImpl) GetNodeLabels ¶ added in v0.6.0
func (m MarshalNodeImpl) GetNodeLabels(ctx context.Context, options *ExplainOptions) ([]models.Label, error)
func (MarshalNodeImpl) GetNodeName ¶ added in v0.6.0
func (m MarshalNodeImpl) GetNodeName(ctx context.Context) (string, error)
func (MarshalNodeImpl) GetNodeTitle ¶ added in v0.6.0
func (m MarshalNodeImpl) GetNodeTitle(ctx context.Context, options *ExplainOptions) (string, error)
func (MarshalNodeImpl) GetStatistics ¶ added in v0.6.0
func (m MarshalNodeImpl) GetStatistics(ctx context.Context, options *ExplainOptions) models.Statistics
func (MarshalNodeImpl) GetStats ¶ added in v0.7.0
func (m MarshalNodeImpl) GetStats() models.Stats
func (MarshalNodeImpl) GetTotalStats ¶ added in v0.6.0
func (m MarshalNodeImpl) GetTotalStats() models.TotalStats
type NodeDescribe ¶
type NodeDescribe interface {
GetNodeBasicInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetExtraInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
GetProjectListInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetJoinTypeInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetJoinConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetFilterConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetOrderByInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetGroupByInfo(ctx context.Context, options *ExplainOptions) (string, error)
GetTableDef(ctx context.Context, options *ExplainOptions) (string, error)
GetActualAnalyzeInfo(ctx context.Context, options *ExplainOptions) (string, error)
}
type NodeDescribeImpl ¶
func NewNodeDescriptionImpl ¶
func NewNodeDescriptionImpl(node *plan.Node) *NodeDescribeImpl
func (*NodeDescribeImpl) GetActualAnalyzeInfo ¶ added in v0.6.0
func (ndesc *NodeDescribeImpl) GetActualAnalyzeInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetAggregationInfo ¶
func (ndesc *NodeDescribeImpl) GetAggregationInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetBlockFilterConditionInfo ¶ added in v0.8.0
func (ndesc *NodeDescribeImpl) GetBlockFilterConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetDedupJoinCtxInfo ¶
func (ndesc *NodeDescribeImpl) GetDedupJoinCtxInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
func (*NodeDescribeImpl) GetExtraInfo ¶
func (ndesc *NodeDescribeImpl) GetExtraInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
func (*NodeDescribeImpl) GetFillColsInfo ¶ added in v1.1.0
func (ndesc *NodeDescribeImpl) GetFillColsInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetFillModeInfo ¶ added in v1.1.0
func (ndesc *NodeDescribeImpl) GetFillModeInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetFilterConditionInfo ¶
func (ndesc *NodeDescribeImpl) GetFilterConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetFullTextSql ¶
func (ndesc *NodeDescribeImpl) GetFullTextSql(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetGroupByInfo ¶
func (ndesc *NodeDescribeImpl) GetGroupByInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetIndexReaderParamInfo ¶
func (ndesc *NodeDescribeImpl) GetIndexReaderParamInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetJoinConditionInfo ¶
func (ndesc *NodeDescribeImpl) GetJoinConditionInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetJoinTypeInfo ¶
func (ndesc *NodeDescribeImpl) GetJoinTypeInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetNodeBasicInfo ¶
func (ndesc *NodeDescribeImpl) GetNodeBasicInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetOrderByInfo ¶
func (ndesc *NodeDescribeImpl) GetOrderByInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetProjectListInfo ¶
func (ndesc *NodeDescribeImpl) GetProjectListInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetRecvMessageInfo ¶ added in v1.2.0
func (ndesc *NodeDescribeImpl) GetRecvMessageInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetRuntimeFilteProbeInfo ¶ added in v0.8.0
func (ndesc *NodeDescribeImpl) GetRuntimeFilteProbeInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetRuntimeFilterBuildInfo ¶ added in v0.8.0
func (ndesc *NodeDescribeImpl) GetRuntimeFilterBuildInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetSampleFuncInfo ¶ added in v1.1.0
func (ndesc *NodeDescribeImpl) GetSampleFuncInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetSendMessageInfo ¶ added in v1.2.0
func (ndesc *NodeDescribeImpl) GetSendMessageInfo(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetTableDef ¶
func (ndesc *NodeDescribeImpl) GetTableDef(ctx context.Context, options *ExplainOptions) (string, error)
func (*NodeDescribeImpl) GetUpdateCtxInfo ¶
func (ndesc *NodeDescribeImpl) GetUpdateCtxInfo(ctx context.Context, options *ExplainOptions) ([]string, error)
func (*NodeDescribeImpl) GetWindowSpectListInfo ¶ added in v0.8.0
func (ndesc *NodeDescribeImpl) GetWindowSpectListInfo(ctx context.Context, options *ExplainOptions) (string, error)
type NodeElemDescribe ¶
type OrderByDescribeImpl ¶
type OrderByDescribeImpl struct {
OrderBy []*plan.OrderBySpec
}
func NewOrderByDescribeImpl ¶
func NewOrderByDescribeImpl(OrderBy []*plan.OrderBySpec) *OrderByDescribeImpl
func (*OrderByDescribeImpl) GetDescription ¶
func (o *OrderByDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error
type RowsetDataDescribeImpl ¶
type RowsetDataDescribeImpl struct {
TableDef *plan.TableDef
RowsetData *plan.RowsetData
}
func (*RowsetDataDescribeImpl) GetDescription ¶
func (r *RowsetDataDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error
type WinSpecDescribeImpl ¶
type WinSpecDescribeImpl struct {
WinSpec *plan.WindowSpec
}
func (*WinSpecDescribeImpl) GetDescription ¶
func (w *WinSpecDescribeImpl) GetDescription(ctx context.Context, options *ExplainOptions, buf *bytes.Buffer) error