{"modulePath":"github.com/matrixorigin/matrixone","version":"v0.0.0-debug-20260702","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package models\n\n## Constants\n\n```go\nconst (\n\tIsFirstMask = 1 \u003c\u003c 0 // 0001\n\tIsLastMask  = 1 \u003c\u003c 1 // 0010\n)\n```\n\n```go\nconst DiskIO = \"Disk IO\"\n```\n\n```go\nconst ExternalScan = \"External Scan\"\n```\n\n```go\nconst FSCacheDiskHit = \"FileService Cache Disk Hit\"\n```\n\n```go\nconst FSCacheDiskRead = \"FileService Cache Disk Read\"\n```\n\n```go\nconst FSCacheHit = \"FileService Cache Hit\"\n```\n\n```go\nconst FSCacheMemoryHit = \"FileService Cache Memory Hit\"\n```\n\n```go\nconst FSCacheMemoryRead = \"FileService Cache Memory Read\"\n```\n\n```go\nconst FSCacheRead = \"FileService Cache Read\"\n```\n\n```go\nconst FSCacheRemoteHit = \"FileService Cache Remote Hit\"\n```\n\n```go\nconst FSCacheRemoteRead = \"FileService Cache Remote Read\"\n```\n\n```go\nconst InputRows = \"Input Rows\"\n```\n\n```go\nconst InputSize = \"Input Size\"\n```\n\n```go\nconst InsertTime = \"Insert Time\"\n```\n\n```go\nconst MemorySize = \"Memory Size\"\n```\n\n```go\nconst Network = \"Network\"\n```\n\n```go\nconst OutputRows = \"Output Rows\"\n```\n\n```go\nconst OutputSize = \"Output Size\"\n```\n\n```go\nconst S3Delete = \"S3 Delete Count\"\n```\n\n```go\nconst S3DeleteMul = \"S3 DeleteMul Count\"\n```\n\n```go\nconst S3Get = \"S3 Get Count\"\n```\n\n```go\nconst S3Head = \"S3 Head Count\"\n```\n\n```go\nconst S3List = \"S3 List Count\"\n```\n\n```go\nconst S3Put = \"S3 Put Count\"\n```\n\n```go\nconst ScanBytes = \"Scan Bytes\"\n```\n\n```go\nconst ScanTime = \"Scan Time\"\n```\n\n```go\nconst TableScan = \"Table Scan\"\n```\n\n```go\nconst TimeConsumed = \"Time Consumed\"\n```\n\n```go\nconst WaitTime = \"Wait Time\"\n```\n\n## Functions\n\n```go\nfunc CalcTotalS3Requests(gblStats GblStats, statsInfo *statistic.StatsInfo) (list, head, put, get, delete, deleteMul, writtenRows, deletedRows int64)\n```\nCalcTotalS3Requests calculates the total number of S3 requests (List, Head, Put, Get, Delete, DeleteMul) by summing up values from global statistics (gblStats) and different stages of the execution process (PlanStage, CompileStage, and PrepareRunStage) in the statsInfo.\n\n```go\nfunc ExplainPhyPlan(phy *PhyPlan, statsInfo *statistic.StatsInfo, option ExplainOption) string\n```\nExplainPhyPlan used to \\`mo\\_explan\\_phy\\` internal function\n\n```go\nfunc PhyPlanToJSON(p *PhyPlan) (string, error)\n```\n\n```go\nfunc PrintPipelineTree(node *PhyOperator, prefix string, isRoot, isTail bool, option ExplainOption, buffer *bytes.Buffer)\n```\n\n## Types\n\n```go\ntype Edge struct {\n\tId     string `json:\"id\"`\n\tSrc    string `json:\"src\"`\n\tDst    string `json:\"dst\"`\n\tOutput int64  `json:\"output\"`\n\tUnit   string `json:\"unit\"`\n}\n```\n\n```go\ntype ExplainData struct {\n\tSteps        []Step `json:\"steps\"`\n\tCode         uint16 `json:\"code\"`\n\tMessage      string `json:\"message\"`\n\tUuid         string `json:\"uuid\"`\n\tPhyPlan      PhyPlan\n\tNewPlanStats statistic.StatsInfo\n}\n```\n\n```go\nfunc NewExplainData(uuid uuid.UUID) *ExplainData\n```\n\n```go\nfunc NewExplainDataFail(uuid uuid.UUID, code uint16, msg string) *ExplainData\n```\n\n```go\nfunc (d *ExplainData) StatisticsRead() (rows int64, size int64)\n```\nStatisticsRead statistics read rows, size in ExplainData\n\nDeprecated: please use explain.GetInputRowsAndInputSize instead.\n\n```go\ntype ExplainOption int\n```\n\n```go\nconst (\n\tNormalOption ExplainOption = iota\n\tVerboseOption\n\tAnalyzeOption\n)\n```\n\n```go\ntype GblStats struct {\n\tScopePrepareTimeConsumed int64\n\tOperatorTimeConsumed     int64\n\tMemorySize               int64\n\tSpillSize                int64\n\tNetWorkSize              int64\n\tDiskIOSize               int64\n\tS3ListRequest            int64\n\tS3HeadRequest            int64\n\tS3PutRequest             int64\n\tS3GetRequest             int64\n\tS3DeleteRequest          int64\n\tS3DeleteMultiRequest     int64\n\tWrittenRows              int64\n\tDeletedRows              int64\n}\n```\nGblStats used to hold the total time and wait time of physical plan execution, rename to PhyGblStats\n\n```go\nfunc ExtractPhyPlanGlbStats(plan *PhyPlan) GblStats\n```\nFunction to process the entire PhyPlan and extract the stats\n\n```go\ntype Global struct {\n\tStatistics Statistics `json:\"statistics\"`\n\tTotalStats TotalStats `json:\"totalStats\"`\n}\n```\n\n```go\nfunc NewGlobal() *Global\n```\n\n```go\ntype GraphData struct {\n\tNodes  []Node  `json:\"nodes\"`\n\tEdges  []Edge  `json:\"edges\"`\n\tLabels []Label `json:\"labels\"`\n\tGlobal Global  `json:\"global\"`\n}\n```\n\n```go\nfunc NewGraphData(nodeSize int) *GraphData\n```\n\n```go\nfunc (graphData *GraphData) StatisticsGlobalResource(ctx context.Context) error\n```\nStatistics of global resource usage, adding resources of all nodes\n\n```go\ntype Label struct {\n\tName  string      `json:\"name\"`\n\tValue interface{} `json:\"value\"`\n}\n```\n\n```go\nfunc NewLabel(name string, value interface{}) *Label\n```\n\n```go\ntype Node struct {\n\tNodeId     string     `json:\"id\"`\n\tName       string     `json:\"name\"`\n\tTitle      string     `json:\"title\"`\n\tLabels     []Label    `json:\"labels\"`\n\tStatistics Statistics `json:\"statistics\"`\n\tStats      Stats      `json:\"stats\"`\n\tTotalStats TotalStats `json:\"totalStats\"`\n}\n```\n\n```go\ntype PhyOperator struct {\n\tOpName       string                 `json:\"OpName\"`\n\tNodeIdx      int                    `json:\"NodeIdx\"`\n\tStatus       uint8                  `json:\"Status\"`\n\tDestReceiver []PhyReceiver          `json:\"toMergeReceiver,omitempty\"`\n\tOpStats      *process.OperatorStats `json:\"OpStats,omitempty\"`\n\tChildren     []*PhyOperator         `json:\"Children,omitempty\"`\n\tIsFirst      bool                   `json:\"IsFirst,omitempty\"`\n\tIsLast       bool                   `json:\"IsLast,omitempty\"`\n}\n```\n\n```go\ntype PhyPlan struct {\n\tVersion     string     `json:\"version\"`\n\tRetryTime   int        `json:\"retryTime,omitempty\"`\n\tLocalScope  []PhyScope `json:\"scope,omitempty\"`\n\tRemoteScope []PhyScope `json:\"RemoteScope,omitempty\"`\n}\n```\n\n```go\nfunc JSONToPhyPlan(jsonStr string) (PhyPlan, error)\n```\n\n```go\nfunc NewPhyPlan() *PhyPlan\n```\n\n```go\ntype PhyReceiver struct {\n\tIdx        int    `json:\"Idx\"`\n\tRemoteUuid string `json:\"Uuid,omitempty\"`\n}\n```\n\n```go\ntype PhyScope struct {\n\tMagic               string        `json:\"Magic\"`\n\tMcpu                int8          `json:\"Mcpu,omitempty\"`\n\tReceiver            []PhyReceiver `json:\"Receiver,omitempty\"`\n\tDataSource          *PhySource    `json:\"DataSource,omitempty\"`\n\tPreScopes           []PhyScope    `json:\"PreScopes,omitempty\"`\n\tRootOperator        *PhyOperator  `json:\"RootOperator,omitempty\"`\n\tPrepareTimeConsumed int64         `json:\"PrepareTimeConsumed,omitempty\"`\n}\n```\n\n```go\ntype PhySource struct {\n\tSchemaName   string   `json:\"SchemaName\"`\n\tRelationName string   `json:\"TableName\"`\n\tAttributes   []string `json:\"Columns\"`\n}\n```\n\n```go\ntype PlanStats struct {\n}\n```\n\n```go\ntype StatisticValue struct {\n\tName  string `json:\"name\"`\n\tValue int64  `json:\"value\"`\n\tUnit  string `json:\"unit\"`\n}\n```\n\n```go\nfunc NewStatisticValue(name string, unit string) *StatisticValue\n```\n\n```go\ntype Statistics struct {\n\tTime       []StatisticValue `json:\"Time\"`\n\tMemory     []StatisticValue `json:\"Memory\"`\n\tThroughput []StatisticValue `json:\"Throughput\"`\n\tIO         []StatisticValue `json:\"IO\"`\n\tNetwork    []StatisticValue `json:\"Network\"`\n}\n```\n\n```go\nfunc NewStatistics() *Statistics\n```\n\n```go\ntype Stats struct {\n\tBlockNum    int32   `json:\"blocknum\"`\n\tOutcnt      float64 `json:\"outcnt\"`\n\tCost        float64 `json:\"cost\"`\n\tHashmapSize float64 `json:\"hashmapsize\"`\n\tRowsize     float64 `json:\"rowsize\"`\n}\n```\n\n```go\ntype Step struct {\n\tGraphData   GraphData `json:\"graphData\"`\n\tStep        int       `json:\"step\"`\n\tDescription string    `json:\"description\"`\n\tState       string    `json:\"state\"`\n\tPlanStats   PlanStats `json:\"stats\"`\n}\n```\n\n```go\nfunc NewStep(step int) *Step\n```\n\n```go\ntype TotalStats struct {\n\tName  string `json:\"name\"`\n\tValue int64  `json:\"value\"`\n\tUnit  string `json:\"unit\"`\n}\n```\n\n","path":"github.com/matrixorigin/matrixone/pkg/sql/models","name":"models","synopsis":"","isRedistributable":true}
