3
0
Files
corteza/pkg/dal/optimization.go
Tomaž Jerman a6abc01927 Outline base pipeline step definition and costing model
Pipeline step definitions are used to construct underlaying
execution nodes operate over datasources.

The costing model is the initial approach to provide optimizers
more context on what they should do.
2022-09-01 16:55:20 +02:00

44 lines
728 B
Go

package dal
type (
// opCost provides a general idea of expensive an operation is for a
// specific pipeline step.
//
// dsSize provides a general idea of how large an underlaying dataset is.
opCost int
dsSize int
stepAnalysis struct {
scanCost opCost
searchCost opCost
filterCost opCost
sortCost opCost
outputSize dsSize
}
)
var (
pipelineOptimizers = []func(PipelineStep, bool) (PipelineStep, error){
// @todo add more optimizers
}
)
const (
// operation computation indicators
costUnknown opCost = iota
costFree
costCheep
costAcceptable
costExpensive
costInfinite
)
const (
// dataset size indicators
sizeUnknown dsSize = iota
sizeTiny
sizeSmall
sizeMedium
sizeLarge
)