Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - type Analyze
 - type AnalyzeInfo
 - type Limitation
 - type Process
 - func (proc *Process) AllocVectorOfRows(typ types.Type, nele int, nsp *nulls.Nulls) (*vector.Vector, error)
 - func (proc *Process) CopyValueScanBatch(src *Process)
 - func (proc *Process) CopyVectorPool(src *Process)
 - func (proc *Process) FreeVectors()
 - func (proc *Process) GetAnalyze(idx int) Analyze
 - func (proc *Process) GetLastInsertID() uint64
 - func (proc *Process) GetMPool() *mpool.MPool
 - func (proc *Process) GetPrepareBatch() *batch.Batch
 - func (proc *Process) GetPrepareExprList() any
 - func (proc *Process) GetPrepareParams() *vector.Vector
 - func (proc *Process) GetPrepareParamsAt(i int) (*vector.Vector, error)
 - func (proc *Process) GetResolveVariableFunc() func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
 - func (proc *Process) GetSessionInfo() *SessionInfo
 - func (proc *Process) GetValueScanBatch(key uuid.UUID) *batch.Batch
 - func (proc *Process) GetValueScanBatchs() []*batch.Batch
 - func (proc *Process) GetVector(typ types.Type) *vector.Vector
 - func (proc *Process) InitSeq()
 - func (proc *Process) InputBatch() *batch.Batch
 - func (proc *Process) MarshalBinary() ([]byte, error)
 - func (proc *Process) Mp() *mpool.MPool
 - func (proc *Process) OperatorOutofMemory(size int64) bool
 - func (proc *Process) PutBatch(bat *batch.Batch)
 - func (proc *Process) PutVector(vec *vector.Vector)
 - func (proc *Process) QueryId() string
 - func (proc *Process) ResetContextFromParent(parent context.Context) context.Context
 - func (proc *Process) SetCacheForAutoCol(name string)
 - func (proc *Process) SetInputBatch(bat *batch.Batch)
 - func (proc *Process) SetLastInsertID(num uint64)
 - func (proc *Process) SetPrepareBatch(bat *batch.Batch)
 - func (proc *Process) SetPrepareExprList(exprList any)
 - func (proc *Process) SetPrepareParams(prepareParams *vector.Vector)
 - func (proc *Process) SetQueryId(id string)
 - func (proc *Process) SetResolveVariableFunc(f func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error))
 - func (proc *Process) SetValueScanBatch(key uuid.UUID, batch *batch.Batch)
 - func (proc *Process) UnmarshalBinary(_ []byte) error
 - func (proc *Process) WithSpanContext(sc trace.SpanContext)
 
- type Register
 - type SessionInfo
 - func (si *SessionInfo) GetCharset() string
 - func (si *SessionInfo) GetCollation() string
 - func (si *SessionInfo) GetConnectionID() uint64
 - func (si *SessionInfo) GetDatabase() string
 - func (si *SessionInfo) GetHost() string
 - func (si *SessionInfo) GetRole() string
 - func (si *SessionInfo) GetUser() string
 - func (si *SessionInfo) GetUserHost() string
 - func (si *SessionInfo) GetVersion() string
 
- type WaitRegister
 - type WrapCs
 
Constants ¶
      View Source
      
  
const (
	VectorLimit = 32
)
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyze ¶ added in v0.6.0
type Analyze interface {
	Stop()
	Start()
	Alloc(int64)
	Input(*batch.Batch, bool)
	Output(*batch.Batch, bool)
	WaitStop(time.Time)
	DiskIO(*batch.Batch)
	S3IOByte(*batch.Batch)
	S3IOInputCount(int)
	S3IOOutputCount(int)
	Network(*batch.Batch)
	AddScanTime(t time.Time)
	AddInsertTime(t time.Time)
}
    Analyze analyzes information for operator
type AnalyzeInfo ¶ added in v0.5.1
type AnalyzeInfo struct {
	// NodeId, index of query's node list
	NodeId int32
	// InputRows, number of rows accepted by node
	InputRows int64
	// OutputRows, number of rows output by node
	OutputRows int64
	// TimeConsumed, time taken by the node in milliseconds
	TimeConsumed int64
	// WaitTimeConsumed, time taken by the node waiting for channel in milliseconds
	WaitTimeConsumed int64
	// InputSize, data size accepted by node
	InputSize int64
	// OutputSize, data size output by node
	OutputSize int64
	// MemorySize, memory alloc by node
	MemorySize int64
	// DiskIO, data size read from disk
	DiskIO int64
	// S3IOByte, data size read from s3
	S3IOByte int64
	// S3IOInputCount, count for PUT, COPY, POST and LIST
	S3IOInputCount int64
	// S3IOOutputCount, count for GET, SELECT and other
	S3IOOutputCount int64
	// NetworkIO, message size send between CN node
	NetworkIO int64
	// ScanTime, scan cost time in external scan
	ScanTime int64
	// InsertTime, insert cost time in load flow
	InsertTime int64
}
    AnalyzeInfo analyze information for query
func NewAnalyzeInfo ¶ added in v0.6.0
func NewAnalyzeInfo(nodeId int32) *AnalyzeInfo
type Limitation ¶
type Limitation struct {
	// Size, memory threshold for operator.
	Size int64
	// BatchRows, max rows for batch.
	BatchRows int64
	// BatchSize, max size for batch.
	BatchSize int64
	// PartitionRows, max rows for partition.
	PartitionRows int64
	// ReaderSize, memory threshold for storage's reader
	ReaderSize int64
	// MaxMessageSize max size for read messages from dn
	MaxMsgSize uint64
}
    Limitation specifies the maximum resources that can be used in one query.
type Process ¶
type Process struct {
	// Id, query id.
	Id  string
	Reg Register
	Lim Limitation
	// unix timestamp
	UnixTime int64
	TxnClient client.TxnClient
	TxnOperator client.TxnOperator
	AnalInfos []*AnalyzeInfo
	SessionInfo SessionInfo
	Ctx context.Context
	Cancel context.CancelFunc
	FileService fileservice.FileService
	LockService lockservice.LockService
	IncrService incrservice.AutoIncrementService
	LoadTag bool
	LastInsertID *uint64
	LoadLocalReader *io.PipeReader
	DispatchNotifyCh chan WrapCs
	Aicm *defines.AutoIncrCacheManager
	// contains filtered or unexported fields
}
    Process contains context used in query execution one or more pipeline will be generated for one query, and one pipeline has one process instance.
func New ¶
func New( ctx context.Context, m *mpool.MPool, txnClient client.TxnClient, txnOperator client.TxnOperator, fileService fileservice.FileService, lockService lockservice.LockService, aicm *defines.AutoIncrCacheManager) *Process
New creates a new Process. A process stores the execution context.
func NewFromProc ¶ added in v0.5.0
NewFromProc create a new Process based on another process.
func NewWithAnalyze ¶ added in v0.6.0
func (*Process) AllocVectorOfRows ¶ added in v0.6.0
func (*Process) CopyValueScanBatch ¶ added in v0.8.0
func (*Process) CopyVectorPool ¶ added in v0.8.0
func (*Process) FreeVectors ¶ added in v0.8.0
func (proc *Process) FreeVectors()
func (*Process) GetAnalyze ¶ added in v0.6.0
func (*Process) GetLastInsertID ¶ added in v0.7.0
func (*Process) GetPrepareBatch ¶ added in v0.8.0
func (*Process) GetPrepareExprList ¶ added in v0.8.0
func (*Process) GetPrepareParams ¶ added in v0.8.0
func (*Process) GetPrepareParamsAt ¶ added in v0.8.0
func (*Process) GetResolveVariableFunc ¶ added in v0.8.0
func (*Process) GetSessionInfo ¶ added in v0.8.0
func (proc *Process) GetSessionInfo() *SessionInfo
func (*Process) GetValueScanBatch ¶ added in v0.8.0
func (*Process) GetValueScanBatchs ¶ added in v0.8.0
func (*Process) InputBatch ¶ added in v0.6.0
func (*Process) MarshalBinary ¶ added in v0.6.0
func (*Process) OperatorOutofMemory ¶ added in v0.6.0
func (*Process) ResetContextFromParent ¶ added in v0.8.0
func (*Process) SetCacheForAutoCol ¶ added in v0.8.0
func (*Process) SetInputBatch ¶ added in v0.6.0
func (*Process) SetLastInsertID ¶ added in v0.7.0
func (*Process) SetPrepareBatch ¶ added in v0.8.0
func (*Process) SetPrepareExprList ¶ added in v0.8.0
func (*Process) SetPrepareParams ¶ added in v0.8.0
func (*Process) SetQueryId ¶ added in v0.6.0
func (*Process) SetResolveVariableFunc ¶ added in v0.8.0
func (*Process) SetValueScanBatch ¶ added in v0.8.0
func (*Process) UnmarshalBinary ¶ added in v0.6.0
func (*Process) WithSpanContext ¶ added in v0.7.0
func (proc *Process) WithSpanContext(sc trace.SpanContext)
type Register ¶
type Register struct {
	// Ss, temporarily stores the row number list in the execution of operators,
	// and it can be reused in the future execution.
	Ss [][]int64
	// InputBatch, stores the result of the previous operator.
	InputBatch *batch.Batch
	// MergeReceivers, receives result of multi previous operators from other pipelines
	// e.g. merge operator.
	MergeReceivers []*WaitRegister
}
    Register used in execution pipeline and shared with all operators of the same pipeline.
type SessionInfo ¶ added in v0.5.0
type SessionInfo struct {
	Account        string
	User           string
	Host           string
	Role           string
	ConnectionID   uint64
	AccountId      uint32
	RoleId         uint32
	UserId         uint32
	LastInsertID   uint64
	Database       string
	Version        string
	TimeZone       *time.Location
	StorageEngine  engine.Engine
	QueryId        []string
	ResultColTypes []types.Type
	SeqCurValues   map[uint64]string
	SeqDeleteKeys  []uint64
	SeqAddValues   map[uint64]string
	SeqLastValue   []string
	SqlHelper      sqlHelper
}
    SessionInfo session information
func (*SessionInfo) GetCharset ¶ added in v0.5.0
func (si *SessionInfo) GetCharset() string
func (*SessionInfo) GetCollation ¶ added in v0.5.0
func (si *SessionInfo) GetCollation() string
func (*SessionInfo) GetConnectionID ¶ added in v0.5.0
func (si *SessionInfo) GetConnectionID() uint64
func (*SessionInfo) GetDatabase ¶ added in v0.5.0
func (si *SessionInfo) GetDatabase() string
func (*SessionInfo) GetHost ¶ added in v0.5.0
func (si *SessionInfo) GetHost() string
func (*SessionInfo) GetRole ¶ added in v0.5.0
func (si *SessionInfo) GetRole() string
func (*SessionInfo) GetUser ¶ added in v0.5.0
func (si *SessionInfo) GetUser() string
func (*SessionInfo) GetUserHost ¶ added in v0.5.0
func (si *SessionInfo) GetUserHost() string
func (*SessionInfo) GetVersion ¶ added in v0.5.0
func (si *SessionInfo) GetVersion() string
type WaitRegister ¶
WaitRegister channel
func (*WaitRegister) MarshalBinary ¶ added in v0.6.0
func (wreg *WaitRegister) MarshalBinary() ([]byte, error)
func (*WaitRegister) UnmarshalBinary ¶ added in v0.6.0
func (wreg *WaitRegister) UnmarshalBinary(_ []byte) error
 Click to show internal directories. 
   Click to hide internal directories.