variable

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefOptCPUFactor                  = 3.0
	DefOptNetworkFactor              = 1.0
	DefOptScanFactor                 = 1.5
	DefOptDescScanFactor             = 3.0
	DefOptSeekFactor                 = 20.0
	DefOptMemoryFactor               = 0.001
	DefOptDiskFactor                 = 1.5
	DefOptConcurrencyFactor          = 3.0
	DefTiDBProjectionConcurrency     = ConcurrencyUnset
	DefTiDBHashAggPartialConcurrency = ConcurrencyUnset
	DefTiDBHashAggFinalConcurrency   = ConcurrencyUnset
	DefEnableVectorizedExpression    = true
	DefExecutorConcurrency           = 5
)
View Source
const ConcurrencyUnset = -1

ConcurrencyUnset means the value the of the concurrency related variable is unset.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concurrency

type Concurrency struct {

	// ExecutorConcurrency is the number of concurrent worker for all executors.
	ExecutorConcurrency int
	// contains filtered or unexported fields
}

Concurrency defines concurrency values.

func (*Concurrency) HashAggFinalConcurrency

func (c *Concurrency) HashAggFinalConcurrency() int

HashAggFinalConcurrency return the number of concurrent hash aggregation final worker.

func (*Concurrency) HashAggPartialConcurrency

func (c *Concurrency) HashAggPartialConcurrency() int

HashAggPartialConcurrency return the number of concurrent hash aggregation partial worker.

func (*Concurrency) ProjectionConcurrency

func (c *Concurrency) ProjectionConcurrency() int

ProjectionConcurrency return the number of concurrent projection worker.

type PreparedParams

type PreparedParams []types.Datum

PreparedParams contains the parameters of the current prepared statement when executing it.

func (PreparedParams) String

func (pps PreparedParams) String() string

type SessionVars

type SessionVars struct {
	Concurrency

	// PreparedParams params for prepared statements
	PreparedParams PreparedParams

	// Status stands for the session status. e.g. in transaction or not, auto commit is on or off, and so on.
	Status uint16

	// PlanID is the unique id of logical and physical plan.
	PlanID int

	// PlanColumnID is the unique id for column when building plan.
	PlanColumnID int64

	// CurrentDB is the default database of this session.
	CurrentDB string

	// StmtCtx holds variables for current executing statement.
	StmtCtx *stmtctx.StatementContext

	// CPUFactor is the CPU cost of processing one expression for one row.
	CPUFactor float64

	// MemoryFactor is the memory cost of storing one tuple.
	MemoryFactor float64
	// DiskFactor is the IO cost of reading/writing one byte to temporary disk.
	DiskFactor float64
	// ConcurrencyFactor is the CPU cost of additional one goroutine.
	ConcurrencyFactor float64

	// Per-connection time zones. Each client that connects has its own time zone setting, given by the session time_zone variable.
	// See https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html
	TimeZone *time.Location

	SQLMode mysql.SQLMode

	// EnableVectorizedExpression  enables the vectorized expression evaluation.
	EnableVectorizedExpression bool

	MaxAllowedPacket  uint64
	DefaultWeekFormat string
	// contains filtered or unexported fields
}

SessionVars is to handle user-defined or global variables in the current session.

func NewSessionVars

func NewSessionVars() *SessionVars

NewSessionVars creates a session vars object.

func (*SessionVars) AllocPlanColumnID

func (s *SessionVars) AllocPlanColumnID() int64

AllocPlanColumnID allocates column id for plan.

func (*SessionVars) GetCharsetInfo

func (s *SessionVars) GetCharsetInfo() (charset, collation string)

GetCharsetInfo gets charset and collation for current context. What character set should the server translate a statement to after receiving it? For this, the server uses the character_set_connection and collation_connection system variables. It converts statements sent by the client from character_set_client to character_set_connection (except for string literals that have an introducer such as _latin1 or _utf8). collation_connection is important for comparisons of literal strings. For comparisons of strings with column values, collation_connection does not matter because columns have their own collation, which has a higher collation precedence. See https://dev.mysql.com/doc/refman/5.7/en/charset-connection.html

func (*SessionVars) GetDescScanFactor

func (s *SessionVars) GetDescScanFactor(tbl *model.TableInfo) float64

GetDescScanFactor returns the session variable descScanFactor returns 0 when tbl is a temporary table.

func (*SessionVars) GetNetworkFactor

func (s *SessionVars) GetNetworkFactor(tbl *model.TableInfo) float64

GetNetworkFactor returns the session variable networkFactor returns 0 when tbl is a temporary table.

func (*SessionVars) GetScanFactor

func (s *SessionVars) GetScanFactor(tbl *model.TableInfo) float64

GetScanFactor returns the session variable scanFactor returns 0 when tbl is a temporary table.

func (*SessionVars) GetSeekFactor

func (s *SessionVars) GetSeekFactor(tbl *model.TableInfo) float64

GetSeekFactor returns the session variable seekFactor returns 0 when tbl is a temporary table.

func (*SessionVars) Location

func (s *SessionVars) Location() *time.Location

Location returns the value of time_zone session variable. If it is nil, then return time.Local.

Jump to

Keyboard shortcuts

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