Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FormatType ¶
type FormatType int
const ( FormatTypePlanBriefText FormatType = iota //执行计划简要文本,按行输出默认执行计划 FormatTypePlanVerboseText //执行计划详细文本,包含成本预估信息,按行输出详细执行计划 FormatTypePlanBriefJSON FormatTypePlanVerboseJSON FormatTypeAnalyzeBriefText //执行计划分析简要文本,包含执行信息,按行输出默认执行计划 FormatTypeAnalyzeVerboseText //执行计划分析详细文本,包含成本预估信息,执行信息,按行输出详细执行计划 FormatTypeAnalyzeBriefJSON FormatTypeAnalyzeVerboseJSON )
type PlanFlag ¶
type PlanFlag string
const EndFlag PlanFlag = "└─" //占2个字节,当遇到该标志时,说明该行父节点已经是最后一个节点
const RootFlag PlanFlag = "root" //根节点标
const StartFlag PlanFlag = "├─" //占4个字节,当遇到该标志时,说明该行父节点还有兄弟节点
type PlanNode ¶
type PlanNode struct { ID string `json:"id"` //节点ID EstCost float64 `json:"estCost"` //预估成本 EstRows float64 `json:"estRows"` //预估行数 ActRows float64 `json:"actRows"` //实际行数,本应该是int类型,但是为了方便和estRows比较,所以使用float64 Task string `json:"taskType"` //任务名称,如:root, cop[tikv]等 AccessObject string `json:"accessObject"` //访问对象 OperatorInfo string `json:"operatorInfo"` //算子信息 ExecutionInfo string `json:"executeInfo"` //执行信息 Memory int `json:"memoryInfo"` //内存信息 Disk int `json:"diskInfo"` //磁盘信息 PlanType FormatType //执行计划类型 Parent *PlanNode //父节点 Left *PlanNode //左子节点 Right *PlanNode //右子节点 // contains filtered or unexported fields }
func NewPlanTree ¶
func (*PlanNode) AddChildren ¶
func (*PlanNode) GetExecutor ¶
func (*PlanNode) IsBuildSide ¶
type RawPlan ¶
type RawPlan struct { Tp FormatType // 执行计划类型 // contains filtered or unexported fields }
func GetRawPlanFromText ¶
func GetRawPlanFromText(text string, formatType FormatType) (rawPlan *RawPlan, err error)
Click to show internal directories.
Click to hide internal directories.