pev

package module
v0.0.0-...-172f1e0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Limit           NodeType = "Limit"
	Append                   = "Append"
	Sort                     = "Sort"
	NestedLoop               = "Nested Loop"
	MergeJoin                = "Merge Join"
	Hash                     = "Hash"
	HashJoin                 = "Hash Join"
	Aggregate                = "Aggregate"
	Hashaggregate            = "Hashaggregate"
	SequenceScan             = "Seq Scan"
	IndexScan                = "Index Scan"
	IndexOnlyScan            = "Index Only Scan"
	BitmapHeapScan           = "Bitmap Heap Scan"
	BitmapIndexScan          = "Bitmap Index Scan"
	CTEScan                  = "CTE Scan"
)

Variables

View Source
var Descriptions = map[NodeType]string{
	Append:          "Used in a UNION to merge multiple record sets by appending them together.",
	Limit:           "Returns a specified number of rows from a record set.",
	Sort:            "Sorts a record set based on the specified sort key.",
	NestedLoop:      "Merges two record sets by looping through every record in the first set and trying to find a match in the second set. All matching records are returned.",
	MergeJoin:       "Merges two record sets by first sorting them on a join key.",
	Hash:            "Generates a hash table from the records in the input recordset. Hash is used by Hash Join.",
	HashJoin:        "Joins to record sets by hashing one of them (using a Hash Scan).",
	Aggregate:       "Groups records together based on a GROUP BY or aggregate function (e.g. sum()).",
	Hashaggregate:   "Groups records together based on a GROUP BY or aggregate function (e.g. sum()). Hash Aggregate uses a hash to first organize the records by a key.",
	SequenceScan:    "Finds relevant records by sequentially scanning the input record set. When reading from a table, Seq Scans (unlike Index Scans) perform a single read operation (only the table is read).",
	IndexScan:       "Finds relevant records based on an Index. Index Scans perform 2 read operations: one to read the index and another to read the actual value from the table.",
	IndexOnlyScan:   "Finds relevant records based on an Index. Index Only Scans perform a single read operation from the index and do not read from the corresponding table.",
	BitmapHeapScan:  "Searches through the pages returned by the Bitmap Index Scan for relevant rows.",
	BitmapIndexScan: "Uses a Bitmap Index (index which uses 1 bit per page) to find all relevant pages. Results of this node are fed to the Bitmap Heap Scan.",
	CTEScan:         "Performs a sequential scan of Common Table Expression (CTE) query results. Note that results of a CTE are materialized (calculated and temporarily stored).",
}

Functions

func Visualize

func Visualize(writer io.Writer, reader io.Reader, width uint) error

Types

type EstimateDirection

type EstimateDirection string
const (
	Over  EstimateDirection = "Over"
	Under                   = "Under"
)

type Explain

type Explain struct {
	Plan          Plan          `json:"Plan"`
	PlanningTime  float64       `json:"Planning Time"`
	Triggers      []interface{} `json:"Triggers"`
	ExecutionTime float64       `json:"Execution Time"`
	TotalCost     float64
	MaxRows       uint64
	MaxCost       float64
	MaxDuration   float64
}

type NodeType

type NodeType string

type Plan

type Plan struct {
	ActualCost                  float64
	ActualDuration              float64
	ActualLoops                 uint64  `json:"Actual Loops"`
	ActualRows                  uint64  `json:"Actual Rows"`
	ActualStartupTime           float64 `json:"Actual Startup Time"`
	ActualTotalTime             float64 `json:"Actual Total Time"`
	Alias                       string  `json:"Alias"`
	Costliest                   bool
	CTEName                     string   `json:"CTE Name"`
	Filter                      string   `json:"Filter"`
	GroupKey                    []string `json:"Group Key"`
	HashCondition               string   `json:"Hash Cond"`
	HeapFetches                 uint64   `json:"Heap Fetches"`
	IndexCondition              string   `json:"Index Cond"`
	IndexName                   string   `json:"Index Name"`
	IOReadTime                  float64  `json:"I/O Read Time"`
	IOWriteTime                 float64  `json:"I/O Write Time"`
	JoinType                    string   `json:"Join Type"`
	Largest                     bool
	LocalDirtiedBlocks          uint64   `json:"Local Dirtied Blocks"`
	LocalHitBlocks              uint64   `json:"Local Hit Blocks"`
	LocalReadBlocks             uint64   `json:"Local Read Blocks"`
	LocalWrittenBlocks          uint64   `json:"Local Written Blocks"`
	NodeType                    NodeType `json:"Node Type"`
	Output                      []string `json:"Output"`
	ParentRelationship          string   `json:"Parent Relationship"`
	PlannerRowEstimateDirection EstimateDirection
	PlannerRowEstimateFactor    float64
	PlanRows                    uint64 `json:"Plan Rows"`
	PlanWidth                   uint64 `json:"Plan Width"`
	RelationName                string `json:"Relation Name"`
	RowsRemovedByFilter         uint64 `json:"Rows Removed by Filter"`
	RowsRemovedByIndexRecheck   uint64 `json:"Rows Removed by Index Recheck"`
	ScanDirection               string `json:"Scan Direction"`
	Schema                      string `json:"Schema"`
	SharedDirtiedBlocks         uint64 `json:"Shared Dirtied Blocks"`
	SharedHitBlocks             uint64 `json:"Shared Hit Blocks"`
	SharedReadBlocks            uint64 `json:"Shared Read Blocks"`
	SharedWrittenBlocks         uint64 `json:"Shared Written Blocks"`
	Slowest                     bool
	StartupCost                 float64 `json:"Startup Cost"`
	Strategy                    string  `json:"Strategy"`
	TempReadBlocks              uint64  `json:"Temp Read Blocks"`
	TempWrittenBlocks           uint64  `json:"Temp Written Blocks"`
	TotalCost                   float64 `json:"Total Cost"`
	Plans                       []Plan  `json:"Plans"`
}

Jump to

Keyboard shortcuts

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