Prevent agg. step offloading on sqlserver

It was not intended to work in v0, there were some blockers.
This will be introduces in later versions.
This commit is contained in:
Tomaž Jerman
2023-04-24 13:14:05 +02:00
parent 1d4ab0bc51
commit f9312750b5
+17 -8
View File
@@ -3,9 +3,10 @@ package dal
import (
"context"
"fmt"
"github.com/cortezaproject/corteza/server/pkg/options"
"sync"
"github.com/cortezaproject/corteza/server/pkg/options"
"github.com/cortezaproject/corteza/server/pkg/errors"
"github.com/cortezaproject/corteza/server/store/adapters/rdbms/ddl"
"github.com/cortezaproject/corteza/server/store/adapters/rdbms/ql"
@@ -111,13 +112,21 @@ func (c *connection) Search(ctx context.Context, m *dal.Model, f filter.Filter)
func (c *connection) Analyze(ctx context.Context, m *dal.Model) (a map[string]dal.OpAnalysis, err error) {
// @todo somehow (probably operations) bring in the info what can be done
// for now, since we're quite rigid on the drivers, this will do.
a = map[string]dal.OpAnalysis{
dal.OpAnalysisAggregate: {
ScanCost: dal.CostCheep,
SearchCost: dal.CostCheep,
FilterCost: dal.CostCheep,
SortCost: dal.CostCheep,
},
//
// @note this is a temporary hack until we properly address the first point.
// No point in complicating it at this stage.
if c.db.DriverName() == "sqlserver" {
a = map[string]dal.OpAnalysis{}
} else {
a = map[string]dal.OpAnalysis{
dal.OpAnalysisAggregate: {
ScanCost: dal.CostCheep,
SearchCost: dal.CostCheep,
FilterCost: dal.CostCheep,
SortCost: dal.CostCheep,
},
}
}
return