github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/sql/sessiondatapb/local_only_session_data.proto (about) 1 // Copyright 2021 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 syntax = "proto3"; 12 package cockroach.sql.sessiondatapb; 13 option go_package = "github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb"; 14 15 import "gogoproto/gogo.proto"; 16 17 // LocalOnlySessionData contains the serializable components of session 18 // parameters that only influence execution on the gateway nodes. 19 message LocalOnlySessionData { 20 // SaveTablesPrefix indicates that a table should be created with the 21 // given prefix for the output of each subexpression in a query. If 22 // SaveTablesPrefix is empty, no tables are created. 23 string save_tables_prefix = 1; 24 // OptimizerFKCascadesLimit is the maximum number of cascading operations that 25 // are run for a single query. 26 int64 optimizer_fk_cascades_limit = 2 [(gogoproto.customname) = "OptimizerFKCascadesLimit"]; 27 // StmtTimeout is the duration a query is permitted to run before it is 28 // canceled by the session. If set to 0, there is no timeout. 29 int64 stmt_timeout = 3 [(gogoproto.casttype) = "time.Duration"]; 30 // IdleInSessionTimeout is the duration a session is permitted to idle before 31 // the session is canceled. If set to 0, there is no timeout. 32 int64 idle_in_session_timeout = 4 [(gogoproto.casttype) = "time.Duration"]; 33 // IdleInTransactionSessionTimeout is the duration a session is permitted to 34 // idle in a transaction before the session is canceled. 35 // If set to 0, there is no timeout. 36 int64 idle_in_transaction_session_timeout = 5 [(gogoproto.casttype) = "time.Duration"]; 37 // NoticeDisplaySeverity indicates the level of Severity to send notices for the given 38 // session. This should ideally be of type pgnotice.DisplaySeverity, but cannot be done 39 // due to a circular dependency. 40 uint32 notice_display_severity = 6; 41 // ReorderJoinsLimit indicates the number of joins at which the optimizer should 42 // stop attempting to reorder. 43 int64 reorder_joins_limit = 7; 44 // DefaultTxnPriority indicates the default priority of newly created 45 // transactions. 46 // NOTE: we'd prefer to use tree.UserPriority here, but doing so would 47 // introduce a package dependency cycle. 48 int64 default_txn_priority = 8; 49 // DefaultTxnReadOnly indicates the default read-only status of newly 50 // created transactions. 51 bool default_txn_read_only = 9; 52 // DefaultTxnUseFollowerReads indicates whether transactions should be 53 // created by default using an AS OF SYSTEM TIME clause far enough in the 54 // past to facilitate reads against followers. If true, transactions will 55 // also default to being read-only. 56 bool default_txn_use_follower_reads = 10; 57 // PartiallyDistributedPlansDisabled indicates whether the partially 58 // distributed plans produced by distSQLSpecExecFactory are disabled. It 59 // should be set to 'true' only in tests that verify that the old and the 60 // new factories return exactly the same physical plans. 61 // TODO(yuzefovich): remove it when deleting old sql.execFactory. 62 bool partially_distributed_plans_disabled = 11; 63 // OptimizerUseHistograms indicates whether we should use histograms for 64 // cardinality estimation in the optimizer. 65 bool optimizer_use_histograms = 12; 66 // OptimizerUseMultiColStats indicates whether we should use multi-column 67 // statistics for cardinality estimation in the optimizer. 68 bool optimizer_use_multi_col_stats = 13; 69 // LocalityOptimizedSearch indicates that the optimizer will try to plan scans 70 // and lookup joins in which local nodes (i.e., nodes in the gateway region) 71 // are searched for matching rows before remote nodes, in the hope that the 72 // execution engine can avoid visiting remote nodes. 73 bool locality_optimized_search = 14; 74 // SafeUpdates causes errors when the client 75 // sends syntax that may have unwanted side effects. 76 bool safe_updates = 15; 77 // PreferLookupJoinsForFKs causes foreign key operations to prefer lookup 78 // joins. 79 bool prefer_lookup_joins_for_fks = 16 [(gogoproto.customname) = "PreferLookupJoinsForFKs"]; 80 // ZigzagJoinEnabled indicates whether the optimizer should try and plan a 81 // zigzag join. 82 bool zigzag_join_enabled = 17; 83 // RequireExplicitPrimaryKeys indicates whether CREATE TABLE statements should 84 // error out if no primary key is provided. 85 bool require_explicit_primary_keys = 18; 86 // ForceSavepointRestart overrides the default SAVEPOINT behavior 87 // for compatibility with certain ORMs. When this flag is set, 88 // the savepoint name will no longer be compared against the magic 89 // identifier `cockroach_restart` in order use a restartable 90 // transaction. 91 bool force_savepoint_restart = 19; 92 // AllowPrepareAsOptPlan must be set to allow use of 93 // PREPARE name AS OPT PLAN '...' 94 bool allow_prepare_as_opt_plan = 20; 95 // TempTablesEnabled indicates whether temporary tables can be created or not. 96 bool temp_tables_enabled = 21; 97 // ImplicitPartitioningEnabled indicates whether implicit column partitioning 98 // can be created. 99 bool implicit_column_partitioning_enabled = 22; 100 reserved 23; 101 // OverrideMultiRegionZoneConfigEnabled indicates whether zone configurations can be 102 // modified for multi-region databases and tables/indexes/partitions. 103 bool override_multi_region_zone_config_enabled = 24; 104 reserved 25; 105 // DisallowFullTableScans indicates whether queries that plan full table scans 106 // should be rejected. 107 bool disallow_full_table_scans = 26; 108 // ImplicitSelectForUpdate is true if FOR UPDATE locking may be used during 109 // the row-fetch phase of mutation statements. 110 bool implicit_select_for_update = 27; 111 // InsertFastPath is true if the fast path for insert (with VALUES input) may 112 // be used. 113 bool insert_fast_path = 28; 114 // AlterColumnTypeGeneralEnabled is true if ALTER TABLE ... ALTER COLUMN ... 115 // TYPE x may be used for general conversions requiring online schema change/ 116 bool alter_column_type_general_enabled = 29; 117 // SynchronousCommit is a dummy setting for the synchronous_commit var. 118 bool synchronous_commit = 30; 119 // EnableSeqScan is a dummy setting for the enable_seqscan var. 120 bool enable_seq_scan = 31; 121 reserved 32; 122 // EnableUniqueWithoutIndexConstraints indicates whether creating unique 123 // constraints without an index is allowed. 124 // TODO(rytaft): remove this once unique without index constraints are fully 125 // supported. 126 bool enable_unique_without_index_constraints = 33; 127 // StubCatalogTablesEnabled allows queries against virtual 128 // tables that are not yet implemented. 129 bool stub_catalog_tables_enabled = 34; 130 // ExperimentalComputedColumnRewrites allows automatic rewriting of computed 131 // column expressions in CREATE TABLE and ALTER TABLE statements. See the 132 // experimentalComputedColumnRewrites cluster setting for a description of the 133 // format. 134 string experimental_computed_column_rewrites = 35; 135 reserved 36; 136 // EnableStreamReplication indicates whether to allow setting up a replication 137 // stream. 138 bool enable_stream_replication = 37; 139 // ResultsBufferSize specifies the size at which the pgwire results buffer 140 // will self-flush. 141 int64 results_buffer_size = 38; 142 // PropagateInputOrdering indicates that when planning a subquery or CTE, the 143 // inner ordering should be propagated to the outer scope if the outer scope 144 // is unordered. PropagateInputOrdering is currently experimental. 145 bool propagate_input_ordering = 39; 146 // ExperimentalDistSQLPlanningMode indicates whether the experimental 147 // DistSQL planning driven by the optimizer is enabled. 148 int64 experimental_distsql_planning_mode = 40 [ 149 (gogoproto.customname) = "ExperimentalDistSQLPlanningMode", 150 (gogoproto.casttype) = "ExperimentalDistSQLPlanningMode" 151 ]; 152 // DistSQLMode indicates whether to run queries using the distributed 153 // execution engine. 154 int64 dist_sql_mode = 41 [ 155 (gogoproto.customname) = "DistSQLMode", 156 (gogoproto.casttype) = "DistSQLExecMode" 157 ]; 158 // SerialNormalizationMode indicates how to handle the SERIAL pseudo-type. 159 int64 serial_normalization_mode = 42 [(gogoproto.casttype) = "SerialNormalizationMode"]; 160 // NewSchemaChangerMode indicates whether to use the new schema changer. 161 int64 new_schema_changer_mode = 43 [(gogoproto.casttype) = "NewSchemaChangerMode"]; 162 // SequenceCache stores sequence values which have been cached using the 163 // CACHE sequence option. 164 map<uint32, sessiondatapb.SequenceCacheEntry> sequence_cache = 44 [(gogoproto.casttype) = "SequenceCache"]; 165 // PlacementEnabled indicates whether PLACEMENT can be used or not. 166 bool placement_enabled = 45; 167 // SessionUserProto is the name of the user which has performed a SET ROLE 168 // command. In other words, it is the name of the user which originally 169 // established the connection before SET ROLE was first performed. 170 // This is only populated when SET ROLE is used, otherwise the session_user 171 // is the same as the UserProto in SessionData. 172 // Postgres allows the SessionUser to be changed with SET SESSION AUTHORIZATION 173 // but CockroachDB doesn't allow that at the time of this writing. 174 string session_user_proto = 46 [(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/security/username.SQLUsernameProto"]; 175 // TxnRowsWrittenLog is the threshold for the number of rows written by a SQL 176 // transaction which - once exceeded - will trigger a logging event to SQL_PERF 177 // (or SQL_INTERNAL_PERF for internal transactions); 0 means disabled. 178 int64 txn_rows_written_log = 47; 179 // TxnRowsWrittenErr is the limit for the number of rows written by a SQL 180 // transaction which - once exceeded - will fail the transaction (or will 181 // trigger a logging event to SQL_INTERNAL_PERF for internal transactions); 0 182 // means disabled. 183 int64 txn_rows_written_err = 48; 184 // TxnRowsReadLog is the threshold for the number of rows read by a SQL 185 // transaction which - once exceeded - will trigger a logging event to SQL_PERF 186 // (or SQL_INTERNAL_PERF for internal transactions); 0 means disabled. 187 int64 txn_rows_read_log = 49; 188 // TxnRowsReadErr is the limit for the number of rows read by a SQL 189 // transaction which - once exceeded - will fail the transaction (or will 190 // trigger a logging event to SQL_INTERNAL_PERF for internal transactions); 0 191 // means disabled. 192 int64 txn_rows_read_err = 50; 193 // AutoRehomingEnabled indicates whether or not REGIONAL BY ROW tables should 194 // have a rehoming ON UPDATE clause added to them. 195 bool auto_rehoming_enabled = 51; 196 // IsSuperuser returns whether the user is a "superuser", which is defined 197 // to be a user with an admin role. 198 bool is_superuser = 52; 199 // LargeFullScanRows is the estimated row count at which a full scan is 200 // considered large, and worthy of logging and/or disabling depending on other 201 // settings. 202 double large_full_scan_rows = 53; 203 // InjectRetryErrorsEnabled causes statements inside an explicit 204 // transaction to return a transaction retry error. It is intended for 205 // developers to test their app's retry logic. 206 // 207 // Note that this session variable is **not** propagated to the internal 208 // executors - use InternalExecutorOverride for that. 209 bool inject_retry_errors_enabled = 54; 210 // NullOrderedLast controls whether NULL is ordered last. We default to 211 // NULLS FIRST for ascending order by default, whereas postgres defaults 212 // to NULLS LAST. 213 bool null_ordered_last = 55; 214 // DisablePlanGists indicates whether we should disable automatic gists. 215 bool disable_plan_gists = 56; 216 // CustomOptions contains a map of all custom session settings. 217 // These session variables have at least one period in their name. 218 map<string, string> custom_options = 57; 219 // IndexRecommendationsEnabled controls whether or not we display index 220 // recommendations below the plan in EXPLAIN. 221 bool index_recommendations_enabled = 58; 222 // AvoidBuffering indicates that the returned data should not be 223 // buffered by conn executor. This is currently used by replication primitives 224 // to ensure the data is flushed to the consumer immediately. 225 // 226 // Does not apply to the InternalExecutor. 227 bool avoid_buffering = 59; 228 // CheckFunctionBodies indicates whether functions are validated during 229 // creation. 230 bool check_function_bodies = 60; 231 // CostScansWithDefaultColSize is true when the optimizer should cost scans 232 // and joins using the same default number of bytes per column instead of 233 // column sizes from the AvgSize table statistic. 234 bool cost_scans_with_default_col_size = 61; 235 // DefaultTxnQualityOfService indicates the default QoSLevel/WorkPriority of 236 // newly created transactions. 237 int32 default_txn_quality_of_service = 62 [(gogoproto.casttype)="QoSLevel"]; 238 // OptSplitScanLimit indicates the maximum number of UNION ALL statements a 239 // Scan may be split into during query optimization to avoid a sort. 240 int32 opt_split_scan_limit = 63; 241 // EnableSuperRegions is true when super region functionality is enabled. 242 bool enable_super_regions = 64; 243 // OverrideAlterPrimaryRegionInSuperRegion is true when the user is allowed 244 // to modify a primary region that is part of a super region. 245 bool override_alter_primary_region_in_super_region = 65; 246 // EnableImplicitTransactionForBatchStatements configures the handling of 247 // multiple statements in a single query. If enabled, then an implicit 248 // transaction is used when multiple statements are sent in a single query. 249 // Setting this to false is a divergence from the pgwire protocol, but 250 // matches the behavior of CockroachDB v21.2 and earlier. 251 bool enable_implicit_transaction_for_batch_statements = 66; 252 // ExpectAndIgnoreNotVisibleColumnsInCopy changes behaviour for COPY t FROM ... 253 // (with no column name specifiers) to expect and ignore not visible column 254 // fields. 255 bool expect_and_ignore_not_visible_columns_in_copy = 67; 256 // MultipleModificationsOfTable allows statements containing multiple INSERT 257 // ON CONFLICT, UPSERT, UPDATE, or DELETE subqueries modifying the same table, 258 // at the risk of data corruption if the same row is modified multiple times. 259 bool multiple_modifications_of_table = 68; 260 // ShowPrimaryKeyConstraintOnNotVisibleColumns controls whether SHOW 261 // CONSTRAINTS and pg_catalog.pg_constraint will include primary key 262 // constraints that only include hidden columns. 263 bool show_primary_key_constraint_on_not_visible_columns = 69; 264 // TestingOptimizerRandomSeed is non-zero when we are testing the optimizer by 265 // randomly perturbing costs or disabling rules. This will initialize a rng 266 // seeded to the given integer. This should only be used in test scenarios and 267 // is very much a non-production setting. 268 int64 testing_optimizer_random_seed = 70; 269 // UnconstrainedNonCoveringIndexScanEnabled controls whether unconstrained 270 // non-covering index scan access paths are explored by the optimizer. 271 bool unconstrained_non_covering_index_scan_enabled = 71; 272 // TestingOptimizerCostPerturbation is non-zero when the coster should 273 // randomly perturb costs to produce a non-optimal query plan. This should 274 // only be used in test scenarios and is very much a non-production setting. 275 double testing_optimizer_cost_perturbation = 72; 276 // TestingOptimizerDisableRuleProbability is non-zero when the optimizer 277 // should randomly disable every non-essential transformation rule with the 278 // given probability. This should only be used in test scenarios and is very 279 // much a non-production setting. 280 double testing_optimizer_disable_rule_probability = 73; 281 // OptimizerUseNotVisibleIndexes indicates whether the optimizer can still 282 // choose to use visible indexes for query plans. 283 bool optimizer_use_not_visible_indexes = 74; 284 // CopyFastPathEnabled controls whether the optimized copy mode is enabled. 285 bool copy_fast_path_enabled = 75; 286 // disable_hoist_projection_in_join_limitation disables the restrictions 287 // placed on projection hoisting during query planning in the optimizer. 288 bool disable_hoist_projection_in_join_limitation = 76; 289 // CopyFromAtomicEnabled controls whether implicit txn copy from operations 290 // are atomic or segmented. 291 bool copy_from_atomic_enabled = 77; 292 // EnforceHomeRegion, when true, causes queries which scan rows from multiple 293 // regions, or which scan rows from a single home region, but initiated from 294 // a gateway region which differs from that home region, to error out. 295 bool enforce_home_region = 78; 296 // OptimizerUseForecasts indicates whether we should use statistics forecasts 297 // for cardinality estimation in the optimizer. 298 bool optimizer_use_forecasts = 79; 299 // VariableInequalityLookupJoinEnabled indicates whether the optimizer should 300 // be allowed to consider lookup joins with inequality conditions, in 301 // addition to the other restrictions on when they are planned. 302 bool variable_inequality_lookup_join_enabled = 80; 303 // TransactionSessionTimeout is the duration a transaction is permitted to 304 // run before the transaction is canceled. If set to 0, there is no timeout. 305 int64 transaction_timeout = 81 [(gogoproto.casttype) = "time.Duration"]; 306 // SystemIdentityProto is the original name of the client presented to pgwire 307 // before it was mapped to a SQL identifier. 308 string system_identity_proto = 82 [(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/security/username.SQLUsernameProto"]; 309 // DescriptorValidationMode indicates whether to validate the descriptors at 310 // read and write time, at read time only, or never. 311 int64 descriptor_validation_mode = 83 [(gogoproto.casttype) = "DescriptorValidationMode"]; 312 // ExperimentalHashGroupJoinEnabled indicates whether the physical planner 313 // will attempt to convert a hash join followed by a hash aggregator into a 314 // single hash group-join operation. At the moment, there is no optimizer 315 // support for this, so some things can be incorrect (e.g. EXPLAIN plans). 316 bool experimental_hash_group_join_enabled = 84; 317 // AllowOrdinalColumnReferences indicates whether the deprecated ordinal 318 // column reference syntax (e.g., `SELECT @1 FROM t`) is allowed. 319 bool allow_ordinal_column_references = 85; 320 // OptimizerUseImprovedDisjunctionStats, when true, indicates that the 321 // optimizer should use improved statistics calculations for disjunctive 322 // filters. 323 bool optimizer_use_improved_disjunction_stats = 86; 324 // OptimizerUseLimitOrderingForStreamingGroupBy enables the exploration rule 325 // which optimizes 'SELECT ... GROUP BY ... ORDER BY ... LIMIT n' queries. 326 // The rule uses the required ordering in the limit expression to inform an 327 // interesting ordering to require from the input to the group-by expression. 328 // This can potentially eliminate a top-k operation. 329 bool optimizer_use_limit_ordering_for_streaming_group_by = 88; 330 // CopyFromRetriesEnabled controls whether retries should be internally 331 // attempted for retriable errors. 332 bool copy_from_retries_enabled = 89; 333 // DeclareCursorStatementTimeoutEnabled controls whether statement timeouts 334 // apply during DECLARE CURSOR. 335 bool declare_cursor_statement_timeout_enabled = 90; 336 // OptimizerUseImprovedSplitDisjunctionForJoins enables the optimizer to split 337 // disjunctions (OR expressions) in more cases in join conditions by building a 338 // UNION of two join expressions. If this setting is true, all disjunctions in 339 // inner, semi, and anti joins will be split. If false, only disjunctions 340 // potentially containing an equijoin condition will be split. 341 bool optimizer_use_improved_split_disjunction_for_joins = 91; 342 // InjectRetryErrorsOnCommitEnabled causes statements inside an explicit 343 // transaction to return a transaction retry error just before transcation commit. 344 // It is intended for developers to test their app's retry logic. 345 bool inject_retry_errors_on_commit_enabled = 92; 346 // EnforceHomeRegionFollowerReadsEnabled, when true, allows the use of 347 // follower reads to dynamically detect and report a query's home region 348 // when the enforce_home_region session setting is also true. 349 bool enforce_home_region_follower_reads_enabled = 93; 350 // OptimizerAlwaysUseHistograms, when true, ensures that the optimizer 351 // always uses histograms to calculate statistics if available. 352 bool optimizer_always_use_histograms = 94; 353 // EnableCreateStatsUsingExtremes, when true, allows the use of CREATE 354 // STATISTICS .. USING EXTREMES. 355 bool enable_create_stats_using_extremes = 95; 356 // AllowRoleMembershipsToChangeDuringTransaction, when true, means that 357 // operations which consult the role membership cache do not retain their 358 // lease on that version of the cache throughout the transaction. The 359 // consequence of this is that the transaction may not experience a singular 360 // view of role membership, and it may be able to commit after the revocation 361 // of a role membership which the transaction relied on has successfully been 362 // committed and acknowledged to the user. 363 bool allow_role_memberships_to_change_during_transaction = 96; 364 // PreparedStatementsCacheSize, when not equal to 0, causes the LRU prepared 365 // statements in a session to be automatically deallocated when total prepared 366 // statement memory usage for that session is more than the cache size. 367 // Execution of these deallocated prepared statements will fail until they are 368 // prepared again. 369 int64 prepared_statements_cache_size = 97; 370 // StreamerEnabled controls whether the Streamer API can be used. 371 bool streamer_enabled = 98; 372 // DisableDropVirtualCluster causes errors when the client 373 // attempts to drop virtual clusters or tenant records. 374 bool disable_drop_virtual_cluster = 99; 375 // MultipleActivePortalEnabled determines if the pgwire portal execution 376 // for certain queries can be paused. If true, portals with read-only SELECT 377 // query without sub/post queries can be executed in interleaving manner, but 378 // with a local execution plan. 379 bool multiple_active_portals_enabled = 100; 380 // UnboundedParallelScans, when true, indicates that the TableReader DistSQL 381 // processors should parallelize scans across ranges. Note that the 382 // parallelization will still be disabled for queries with LIMITs, and it can 383 // lead to increased likelihood of OOMs. 384 bool unbounded_parallel_scans = 101; 385 // OptimizerHoistUncorrelatedEqualitySubqueries, when true, causes the 386 // optimizer to hoist uncorrelated subqueries that are part of an equality 387 // expression with a column reference, which can produce more efficient query 388 // plans. 389 bool optimizer_hoist_uncorrelated_equality_subqueries = 102; 390 // TestingOptimizerInjectPanics indicates whether random panics are injected 391 // during optimization. The goal of this setting is to flush out cases where 392 // panics used for error-propagation are uncaught. 393 bool testing_optimizer_inject_panics = 103; 394 // OptimizerUseImprovedComputedColumnFiltersDerivation, when true, causes the 395 // optimizer to derive filters on computed columns in more cases. Previously, 396 // filters could only be derived when the expression defining the computed 397 // column involved a single column and that column was equated with a single 398 // constant value in a WHERE clause filter. 399 bool optimizer_use_improved_computed_column_filters_derivation = 104; 400 // DefaultTxnIsolationLevel indicates the default isolation level of newly 401 // created transactions. 402 // NOTE: we'd prefer to use tree.IsolationLevel here, but doing so would 403 // introduce a package dependency cycle. 404 int64 default_txn_isolation_level = 105; 405 // ReplicationMode represents the replication parameter passed in during 406 // connection time. 407 ReplicationMode replication_mode = 106; 408 // OptimizerUseImprovedJoinElimination, when true, allows the optimizer to 409 // eliminate joins in more cases by remapping columns from the eliminated 410 // input of the join to equivalent columns from the preserved input. 411 bool optimizer_use_improved_join_elimination = 107; 412 // ImplicitFKLockingForSerializable is true if FOR SHARE locking may be used 413 // while checking the referenced table during an insert or update to a table 414 // with a foreign key under serializable isolation. (Under weaker isolation 415 // levels foreign key checks of the parent table always use FOR SHARE 416 // locking.) 417 bool implicit_fk_locking_for_serializable = 108 [ 418 (gogoproto.customname) = "ImplicitFKLockingForSerializable" 419 ]; 420 // DurableLockingForSerializable is true if we should use durable locking for 421 // SELECT FOR UPDATE statements, SELECT FOR SHARE statements, and constraint 422 // checks under serializable isolation. (Serializable isolation does not 423 // require locking for correctness, so by default we use best-effort locks for 424 // better performance.) Weaker isolation levels always use durable locking. 425 bool durable_locking_for_serializable = 109; 426 // SharedLockingForSerializable, if set to true, means SELECT FOR SHARE and 427 // SELECT FOR KEY SHARE statements issued by transactions that run with 428 // serializable isolation will acquire shared locks; otherwise, they'll 429 // perform non-locking reads. 430 // 431 // Weaker isolation levels always acquire shared locks for SELECT FOR SHARE 432 // and SELECT FOR KEY SHARE statements, regardless of this session setting. 433 bool shared_locking_for_serializable = 112; 434 // MaxRetriesForReadCommitted indicates the maximum number of 435 // automatic retries to perform for statements in explicit READ COMMITTED 436 // transactions that see a transaction retry error. 437 int32 max_retries_for_read_committed = 110; 438 // StrictDDLAtomicity causes errors when the client attempts DDL 439 // operations inside an explicit txn and CockroachDB cannot 440 // guarantee the DDL to be performed atomically. 441 // 442 // When this is not set, a transaction may commit its DML 443 // statements but fail its DDL statements, resulting 444 // in error XXA00 - TransactionCommittedWithSchemaChangeFailure. 445 // 446 // When this is set, that particular atomicity violation should 447 // not occur any more (at the expense of disabling certain 448 // forms of DDL inside explicit txns). 449 bool strict_ddl_atomicity = 111 [(gogoproto.customname) = "StrictDDLAtomicity"]; 450 // UnsafeSettingInterlockKey needs to be set to a special string 451 // before SET CLUSTER SETTING is allowed on an unsafe setting. 452 string unsafe_setting_interlock_key = 113; 453 // OptimizerUseLockOpForSerializable, when true, instructs the optimizer to 454 // implement SELECT FOR UPDATE and SELECT FOR SHARE statements using the Lock 455 // operator under serializable isolation. 456 // 457 // For correctness, under weaker isolation levels the optimizer always 458 // implements SELECT FOR UPDATE and SELECT FOR SHARE using the Lock operator, 459 // regardless of this setting. 460 bool optimizer_use_lock_op_for_serializable = 114; 461 // OptimizerUseProvidedOrderingFix, when true, causes the optimizer to 462 // reconcile provided orderings with required ordering choices. This prevents 463 // internal errors due to incomplete functional dependencies, and also 464 // fixes a bug that incorrectly truncated the provided ordering (see #113072). 465 bool optimizer_use_provided_ordering_fix = 115; 466 // DisableChangefeedReplication, when true, disables changefeed events from 467 // being emitted for changes to data made in a session. 468 bool disable_changefeed_replication = 116; 469 // CopyTxnQualityOfService indicates the default QoSLevel/WorkPriority of the 470 // transactions used to evaluate COPY commands. 471 int32 copy_txn_quality_of_service = 117 [(gogoproto.casttype)="QoSLevel"]; 472 // CopyWritePipeliningEnabled indicates whether the write pipelining is 473 // enabled for implicit txns used by COPY. 474 bool copy_write_pipelining_enabled = 118; 475 // CopyNumRetriesPerBatch determines the number of times a single batch of 476 // rows can be retried for non-atomic COPY. 477 int32 copy_num_retries_per_batch = 120; 478 479 /////////////////////////////////////////////////////////////////////////// 480 // WARNING: consider whether a session parameter you're adding needs to // 481 // be propagated to the remote nodes. If so, that parameter should live // 482 // in the SessionData message instead. // 483 /////////////////////////////////////////////////////////////////////////// 484 } 485 486 // ReplicationMode represents the replication={0,1,on,off,database} connection 487 // parameter in PostgreSQL. 488 enum ReplicationMode { 489 REPLICATION_MODE_DISABLED = 0; 490 REPLICATION_MODE_ENABLED = 1; 491 REPLICATION_MODE_DATABASE = 2; 492 } 493 494 // SequenceCacheEntry is an entry in a SequenceCache. 495 message SequenceCacheEntry { 496 // CachedVersion stores the descpb.DescriptorVersion that cached values are associated with. 497 // The version is checked to determine if cache needs to be invalidated. The version is stored as 498 // a uint32 to prevent an import cycle with the descpb package. 499 uint32 cached_version = 1; 500 // CurrentValue stores the present value of the sequence to be given out. 501 int64 current_value = 2; 502 // Increment stores the amount to Increment the currentVal by each time the 503 // currentVal is used. This value corresponds to descpb.TableDescriptor_SequenceOpts.Increment. 504 int64 increment = 3; 505 // NumValues represents the number of values to cache. The cache is considered 506 // to be empty when NumValues is 0. 507 int64 num_values = 4; 508 }