Documentation
¶
Index ¶
- type BatchExecutor
- type Index
- type IndexManager
- func (im *IndexManager) AddIndex(index *Index)
- func (im *IndexManager) FindBestIndex(tableName string, columns []string) *Index
- func (im *IndexManager) GetIndexStats(indexName string) *IndexStats
- func (im *IndexManager) GetIndices(tableName string) []*Index
- func (im *IndexManager) RecordIndexAccess(indexName string, duration time.Duration)
- type IndexStats
- type MemoryPool
- type PerformanceOptimizer
- type PlanNode
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchExecutor ¶
type BatchExecutor struct {
// contains filtered or unexported fields
}
BatchExecutor 批量执行器
func NewBatchExecutor ¶
func NewBatchExecutor(batchSize int, flushInterval time.Duration, flushFunc func([]interface{}) error) *BatchExecutor
NewBatchExecutor 创建批量执行器
type Index ¶
type Index struct {
Name string
TableName string
Columns []string
Unique bool
Primary bool
Cardinality int64 // 基数(唯一值数量)
}
Index 索引定义
type IndexManager ¶
type IndexManager struct {
// contains filtered or unexported fields
}
IndexManager 索引管理器
func (*IndexManager) FindBestIndex ¶
func (im *IndexManager) FindBestIndex(tableName string, columns []string) *Index
FindBestIndex 查找最佳索引
func (*IndexManager) GetIndexStats ¶
func (im *IndexManager) GetIndexStats(indexName string) *IndexStats
GetIndexStats 获取索引统计
func (*IndexManager) GetIndices ¶
func (im *IndexManager) GetIndices(tableName string) []*Index
GetIndices 获取表的所有索引
func (*IndexManager) RecordIndexAccess ¶
func (im *IndexManager) RecordIndexAccess(indexName string, duration time.Duration)
RecordIndexAccess 记录索引访问
type IndexStats ¶
type IndexStats struct {
Name string
HitCount int64
MissCount int64
AvgAccessTime time.Duration
LastAccessed time.Time
}
IndexStats 索引统计信息
type MemoryPool ¶
type MemoryPool struct {
// contains filtered or unexported fields
}
MemoryPool 内存池(用于重用对象减少GC压力)
func (*MemoryPool) SetPool ¶
func (mp *MemoryPool) SetPool(key string, pool interface{})
SetPool 设置指定类型的池
type PerformanceOptimizer ¶
type PerformanceOptimizer struct {
// contains filtered or unexported fields
}
PerformanceOptimizer 性能优化器
func NewPerformanceOptimizer ¶
func NewPerformanceOptimizer() *PerformanceOptimizer
NewPerformanceOptimizer 创建性能优化器
func (*PerformanceOptimizer) OptimizeQuery ¶
func (po *PerformanceOptimizer) OptimizeQuery(ctx context.Context, plan optimizer.LogicalPlan, optCtx *optimizer.OptimizationContext) (optimizer.LogicalPlan, error)
OptimizeQuery 优化查询
type PlanNode ¶
type PlanNode struct {
Plan interface{} // LogicalPlan 在 optimizer 包中定义
Cost float64
Priority int
Index int
}
PlanNode 计划节点
Click to show internal directories.
Click to hide internal directories.