From f9312750b5db014c1776be636842652bef6916cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Mon, 24 Apr 2023 13:12:34 +0200 Subject: [PATCH] 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. --- server/store/adapters/rdbms/dal/connection.go | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/server/store/adapters/rdbms/dal/connection.go b/server/store/adapters/rdbms/dal/connection.go index 7c50711b8..b6df31e4a 100644 --- a/server/store/adapters/rdbms/dal/connection.go +++ b/server/store/adapters/rdbms/dal/connection.go @@ -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