Skip to content

sql: internal executor doesn't have session init'd properly and is just using go defaults #70888

@cucaroach

Description

@cucaroach

The session data used by the internal executor looks like all the session data defaults are just the go value defaults:

SessionData = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.SessionData} 
 Database = {string} ""
 ApplicationName = {string} "$ internal-claim-jobs"
 UserProto = {github.com/cockroachdb/cockroach/pkg/security.SQLUsernameProto} "root"
 DataConversionConfig = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.DataConversionConfig} 
 VectorizeMode = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.VectorizeExecMode} VectorizeUnset (0)
 TestingVectorizeInjectPanics = {bool} false
 DefaultIntSize = {int32} 0
 Location = {string} ""
 SearchPath = {[]string} nil
 TemporarySchemaName = {string} ""
 SeqState = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.SequenceState} 
 WorkMemLimit = {int64} 0
 IntervalStyleEnabled = {bool} false
 DateStyleEnabled = {bool} false
 LockTimeout = {time.Duration} 0 0s
 Internal = {bool} true
 OnUpdateRehomeRowEnabled = {bool} false
LocalOnlySessionData = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.LocalOnlySessionData} 
 SaveTablesPrefix = {string} ""
 OptimizerFKCascadesLimit = {int64} 0
 StmtTimeout = {time.Duration} 0 0s
 IdleInSessionTimeout = {time.Duration} 0 0s
 IdleInTransactionSessionTimeout = {time.Duration} 0 0s
 NoticeDisplaySeverity = {uint32} 0
 ReorderJoinsLimit = {int64} 0
 DefaultTxnPriority = {int64} 0
 DefaultTxnReadOnly = {bool} false
 DefaultTxnUseFollowerReads = {bool} false
 PartiallyDistributedPlansDisabled = {bool} false
 OptimizerUseHistograms = {bool} false
 OptimizerUseMultiColStats = {bool} false
 LocalityOptimizedSearch = {bool} false
 SafeUpdates = {bool} false
 PreferLookupJoinsForFKs = {bool} false
 ZigzagJoinEnabled = {bool} false
 RequireExplicitPrimaryKeys = {bool} false
 ForceSavepointRestart = {bool} false
 AllowPrepareAsOptPlan = {bool} false
 TempTablesEnabled = {bool} false
 ImplicitColumnPartitioningEnabled = {bool} false
 OverrideMultiRegionZoneConfigEnabled = {bool} false
 HashShardedIndexesEnabled = {bool} false
 DisallowFullTableScans = {bool} false
 ImplicitSelectForUpdate = {bool} false
 InsertFastPath = {bool} false
 AlterColumnTypeGeneralEnabled = {bool} false
 SynchronousCommit = {bool} false
 EnableSeqScan = {bool} false
 EnableUniqueWithoutIndexConstraints = {bool} false
 StubCatalogTablesEnabled = {bool} false
 ExperimentalComputedColumnRewrites = {string} ""
 CopyPartitioningWhenDeinterleavingTable = {bool} false
 EnableStreamReplication = {bool} false
 ResultsBufferSize = {int64} 0
 PropagateInputOrdering = {bool} false
 ExperimentalDistSQLPlanningMode = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.ExperimentalDistSQLPlanningMode} ExperimentalDistSQLPlanningOff (0)
 DistSQLMode = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.DistSQLExecMode} DistSQLOff (0)
 SerialNormalizationMode = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.SerialNormalizationMode} SerialUsesRowID (0)
 NewSchemaChangerMode = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.NewSchemaChangerMode} UseNewSchemaChangerOff (0)
 SequenceCache = {github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb.SequenceCache} nil
 PlacementEnabled = {bool} false
 SessionUserProto = {github.com/cockroachdb/cockroach/pkg/security.SQLUsernameProto} ""
 TxnRowsWrittenLog = {int64} 0
 TxnRowsWrittenErr = {int64} 0
 TxnRowsReadLog = {int64} 0
 TxnRowsReadErr = {int64} 0
 AutoRehomingEnabled = {bool} false
 IsSuperuser = {bool} false
 LargeFullScanRows = {float64} 0

Is this correct? Shouldn't we init some values to their cluster setting defaults? Thinking about EnableZigzagJoin, InsertFastPath, DistSQLMode, VectorizeMode, WorkMemLimit (looks like we interpret 0 as Default, ie 64MB here). Worried about internal queries running slowly because they aren't using all our chops.

Jira issue: CRDB-10271

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions