planner

package
v0.0.0-...-4a7a635 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

planner generates a query plan from an AST (abstract syntax tree) generated by the compiler. The query plan is a tree structure similar to relational algebra. The query plan is then converted to bytecode and fed to the vm (virtual machine) to be ran.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreate

func NewCreate(catalog createCatalog, stmt *compiler.CreateStmt) *createPlanner

NewCreate creates a planner for the given create statement.

func NewInsert

func NewInsert(catalog insertCatalog, stmt *compiler.InsertStmt) *insertPlanner

NewInsert returns an instance of an insert planner for the given AST.

func NewSelect

func NewSelect(catalog selectCatalog, stmt *compiler.SelectStmt) *selectPlanner

NewSelect returns an instance of a select planner for the given AST.

Types

type QueryPlan

type QueryPlan struct {

	// ExplainQueryPlan is a flag indicating if the SQL asked for the query plan
	// to be printed as a string representation with `EXPLAIN QUERY PLAN`.
	ExplainQueryPlan bool
	// contains filtered or unexported fields
}

QueryPlan contains the query plan tree. It is capable of converting the tree to a string representation for a query prefixed with `EXPLAIN QUERY PLAN`.

func (*QueryPlan) ToString

func (p *QueryPlan) ToString() string

ToString evaluates and returns the query plan as a string representation.

Jump to

Keyboard shortcuts

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