explain

package
v0.0.0-...-1567d57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeaderColsPosition

func GetHeaderColsPosition(planText string, withShift bool, splitFlag rune) (cols [][2]int, shift, lineNo int, err error)

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 NewPlanTree(rawPlan *RawPlan) (planNode *PlanNode, err error)

func (*PlanNode) AddChildren

func (p *PlanNode) AddChildren(newChild *PlanNode) error

func (*PlanNode) GetExecutor

func (p *PlanNode) GetExecutor() string

func (*PlanNode) IsBuildSide

func (p *PlanNode) IsBuildSide() bool

func (*PlanNode) IsLeaf

func (p *PlanNode) IsLeaf() bool

func (*PlanNode) Traverse

func (p *PlanNode) Traverse()

type RawPlan

type RawPlan struct {
	Tp FormatType // 执行计划类型
	// contains filtered or unexported fields
}

func GetRawPlanFromText

func GetRawPlanFromText(text string, formatType FormatType) (rawPlan *RawPlan, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL