mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-20 11:22:31 -05:00
go/commands/engine: set analyzer parallelism to 1 for NBF __DOLT__ only
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
gms "github.com/dolthub/go-mysql-server"
|
||||
@@ -37,6 +38,7 @@ import (
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/mysql_file_handler"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/config"
|
||||
"github.com/dolthub/dolt/go/store/types"
|
||||
)
|
||||
|
||||
// SqlEngine packages up the context necessary to run sql queries against dsqle.
|
||||
@@ -79,8 +81,6 @@ func NewSqlEngine(
|
||||
config.IsServerLocked = true
|
||||
}
|
||||
|
||||
parallelism := 1
|
||||
|
||||
dbs, locations, err := CollectDBs(ctx, mrEnv, config.Bulk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -132,6 +132,11 @@ func NewSqlEngine(
|
||||
}
|
||||
|
||||
// Set up engine
|
||||
parallelism := runtime.GOMAXPROCS(0)
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
parallelism = 1
|
||||
}
|
||||
|
||||
engine := gms.New(analyzer.NewBuilder(pro).WithParallelism(parallelism).Build(), &gms.Config{
|
||||
IsReadOnly: config.IsReadOnly,
|
||||
IsServerLocked: config.IsServerLocked,
|
||||
|
||||
Reference in New Issue
Block a user