Documentation
¶
Index ¶
- type ExecutionFeedback
- func (ef *ExecutionFeedback) GetJoinFactor(leftTable, rightTable string) float64
- func (ef *ExecutionFeedback) GetSelectivity(column string) float64
- func (ef *ExecutionFeedback) GetTableSize(table string) (int64, bool)
- func (ef *ExecutionFeedback) RecordJoinFactor(leftTable, rightTable string, leftRows, rightRows, outputRows int64)
- func (ef *ExecutionFeedback) RecordSelectivity(column string, inputRows, outputRows int64)
- func (ef *ExecutionFeedback) RecordTableSize(table string, rows int64)
- func (ef *ExecutionFeedback) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionFeedback ¶
type ExecutionFeedback struct {
// contains filtered or unexported fields
}
ExecutionFeedback collects runtime execution statistics to calibrate the cost model, inspired by the DQ paper's reward feedback mechanism. As queries execute, actual row counts and selectivities are recorded and used to improve future cost estimates.
func GetGlobalFeedback ¶
func GetGlobalFeedback() *ExecutionFeedback
GetGlobalFeedback returns the singleton ExecutionFeedback instance.
func (*ExecutionFeedback) GetJoinFactor ¶
func (ef *ExecutionFeedback) GetJoinFactor(leftTable, rightTable string) float64
GetJoinFactor returns the learned join factor for a table pair. Returns the default value (0.1) if no data is available.
func (*ExecutionFeedback) GetSelectivity ¶
func (ef *ExecutionFeedback) GetSelectivity(column string) float64
GetSelectivity returns the learned selectivity for a column. Returns the default value (0.1) if no data is available.
func (*ExecutionFeedback) GetTableSize ¶
func (ef *ExecutionFeedback) GetTableSize(table string) (int64, bool)
GetTableSize returns the learned table size, if available.
func (*ExecutionFeedback) RecordJoinFactor ¶
func (ef *ExecutionFeedback) RecordJoinFactor(leftTable, rightTable string, leftRows, rightRows, outputRows int64)
RecordJoinFactor records the observed join output factor.
func (*ExecutionFeedback) RecordSelectivity ¶
func (ef *ExecutionFeedback) RecordSelectivity(column string, inputRows, outputRows int64)
RecordSelectivity records the observed selectivity for a filter column.
func (*ExecutionFeedback) RecordTableSize ¶
func (ef *ExecutionFeedback) RecordTableSize(table string, rows int64)
RecordTableSize records the actual row count for a table. Uses exponential moving average to smooth over fluctuations.
func (*ExecutionFeedback) Reset ¶
func (ef *ExecutionFeedback) Reset()
Reset clears all collected feedback data.