The new features and bug fixes noted on this page are not yet documented across CockroachDB's documentation. Links on this page will direct to documentation for the latest stable release.
Get future release notes emailed to you:
v23.1.0-alpha.1
Release Date: December 19, 2022
Downloads
Full CockroachDB executable
SQL-only command-line client executable
- Testing releases are intended for testing and experimentation only. Testing releases are not recommended for production use, as they can lead to data corruption, cluster unavailability, performance issues, or other problems.
- Experimental downloads are not qualified for production use, whether they are for testing releases or production releases.
Docker image
Multi-platform images include support for both Intel and ARM. CockroachDB on ARM systems is experimental and is not yet qualified for production use. Multi-platform images do not take up additional space on your Docker host.
To download the Docker image (multi-platform):
$ docker pull cockroachdb/cockroach-unstable:v23.1.0-alpha.1
Backward-incompatible changes
- Replaced the
cdc_prev()
function in favor of acdc_prev
tuple. This is an incompatible change that may break changefeeds that use the previouscdc_prev()
function. #85177 SHOW RANGES FOR TABLE
now includes rows for all indexes that support the table. Prior to this change,SHOW RANGES FOR TABLE foo
was an alias forSHOW RANGES FOR INDEX foo@primary
. This was causing confusion, as it would miss data for secondary indexes. It is still possible to filter to just the primary index usingSHOW RANGES FOR INDEX foo@primary
. The statement output now also includes the index name. #93545
Security updates
- It is now possible to create TLS client certificates for identity principals that are not a valid SQL username using
cockroach cert create-client
and the new flag--disable-username-validation
. This is meant to be used in combination with the cluster settingserver.identity_map.configuration
and themap
option in HBA rules (server.host_based_authentication.configuration
). To test this feature, usecockroach sql
. Cockroach Labs recommends passing the username separately from the connection URL. #90439 - There is a new SQL session variable
system_identity
defined to contain the identity principal presented by the SQL clients during the initial connection. This may be different fromsession_user
when the identity was mapped, either using GSSAPI andinclude_realm=0
, or when using an identity map. #90439
General changes
- Upgraded gRPC to v1.49.0 #88562
- The connection timeout for cluster-internal connections between nodes has been reduced to 5s to potentially reduce the impact of network issues. Previously, CockroachDB employed a 20s connection timeout. #88625
- CockroachDB no longer shares a TCP connection for the KV and Gossip subsystems. Each subsystem now uses their own connection, so the total number of outgoing and incoming TCP connections at each node in the cluster will increase by 30 to 50 percent. #88625
- Bulk operations now log the (sanitized) destinations they are connecting to. For example:
backup planning to connect to destination gs://test/backupadhoc?AUTH=specified&CREDENTIALS=redacted
. #89531
Enterprise edition changes
SHOW CHANGEFEED JOBS
no longer reveals Confluent schema registry user information, including a user's secret key. This information is now redacted, meaning it will not be stored in CockroachDB internal tables at all. #86603- Changefeeds JSON encoder performance is improved by 50%. #88064
- Changefeeds, using cloud storage sink, now have better throughput. #88395
- Added the cluster setting
changefeed.event_consumer_workers
which allows changefeeds to process events concurrently. #87994 - Changefeed) exports are up to 25% faster due to uniform work assignment. #88672
- Changefeeds can emit files compressed with the ZSTD algorithm, which provides good compression and is much faster than GZIP. In addition, a new, faster implementation of GZIP is used by default. #88635
- When a changefeed is run with the option
virtual_columns = "null"
, the virtual column will be ordered last in each row. #89329 - For Kafka sinks, you can now add the optional JSON field
"Compression"
to thekafka_sink_config
option. This field can be set to"none"
(default),"GZIP"
,"SNAPPY"
,"LZ4"
, or"ZSTD"
. Setting this field will result in the specified compression protocol to be used when emitting events. #90270 - Fixed a bug that could cause changefeeds to fail during a rolling restart. #89913
- Changefeeds now have support for the Parquet format. #89451
- Changefeeds will now treat all errors, unless otherwise indicated, as retryable errors. #90810
- CockroachDB now supports passing in the optional external ID when assuming a role. This is done by extending the values of the comma-separated string value of the
ASSUME_ROLE
parameter to the format<role>;external_id=<id>
. Users can still use the previous format of just<role>
to specify a role without any external ID. When using role chaining, each role in the chain can be associated with a different external ID. #91040 - JWT authentication cluster settings can now be modified from within tenants to better support serverless use cases. #92406
- CDC transformations are now planned and evaluated using the SQL optimizer and distSQL execution. The state of the previous row is now exposed as the
cdc_prev
tuple. #85177 - Changefeeds no longer require the
COCKROACH_EXPERIMENTAL_ENABLE_PER_CHANGEFEED_METRICS
environment variable to be set in order to use themetrics_label
option. #93423 - Changefeeds can now be scheduled at intervals specified in crontab notation. #92232
SQL language changes
- Added the
crdb_internal.to_json_as_changefeed_with_flags
function to help debug JSON changefeeds. #84509 - Added the
regions
column to theSHOW BACKUP
command which will output a string ofALTER DATABASE
commands if the database is a multi-region database andNULL
for everything else. Previously, the user did not have an easy way to see if a backed up database is multi-region. #88136 - Types with length modifiers can now be used to prefix literals. #82028
- A new column
plan_gist
was added tocrdb_internal.{node,cluster}_queries
representing the compressed logical plan. #88770 - You can generate easy-to-read
CREATE INDEX
statements for a table's (secondary) indexes using theSHOW CREATE INDEXES FROM <table_name>
andSHOW CREATE SECONDARY INDEXES FROM <table_name>
statements. #88861 enum_first
,enum_last
, andenum_range
may now takeNULL
arguments as long as their type can be inferred from the expression. #89124- Declarative schema changer support for
ALTER PRIMARY KEY
statements now extends to tables which have secondary indexes. #86176 - The
backup.restore_span.target_size
cluster setting now defaults to384 MiB
. This should reduce the number of ranges created during restore and thereby reduce the merging of ranges that needs to occur after the restore. #89333 - The
transaction_timeout
session variable was added.transaction_timeout
aborts an explicit transaction when it runs longer than the configured duration. When the timer times out, the current statement is cancelled and the transaction enters an aborted state. This timeout does not have any effect when no statement is being executed, so it should be used withidle_in_transaction_timeout
for the best results. #89033 - The
crdb_internal.check_consistency
function now does not include the diff between inconsistent replicas, should they occur. If an inconsistency occurs, the storage engine checkpoints should be inspected. This change is made because the maximum range size limit has been increased from 64 MiB to 512 MiB, so inlining diffs in consistency checks does not scale. #89502 - CockroachDB now shows a hash-sharded check constraint in
SHOW CREATE TABLE
if it is set toNOT VALID
. #89517 - Added the
SHOW FUNCTIONS
andSHOW FUNCTIONS FROM <schema>
statements, which list user-defined functions. #89557 - The default value of
sql.metrics.statement_details.plan_collection.enabled
is nowfalse
. #89847 - CockroachDB now supports executing statements of the form
DELETE FROM ... USING
. #88974 - The cluster setting
sql.ttl.default_range_concurrency
and table storage parameterttl_range_concurrency
are no longer configurable. #89392 - CockroachDB drops the associated scheduled incremental backup when
DROP SCHEDULE
orDROP SCHEDULES
is called. Previously, whenever a user dropped a scheduled full backup, the corresponding scheduled incremental backup would not be dropped. #89768 - Added the
sql.auth.change_own_password.enabled
cluster setting. It defaults tofalse
. When set totrue
, any user is allowed to change their own password to a non-null value. Changing other role options still has the same privilege requirements as before (eitherCREATEROLE
orCREATELOGIN
, depending on the option). #90485 - The
sql.distsql.max_running_flows
cluster setting has been removed. #84888 - The query field in the
crdb_internal.node_queries
,crdb_internal.cluster_queries
, andSHOW QUERIES
commands now includes the original comments in the queries. #86968 - Added a new
descriptor_validation
session variable which can be set toread_only
oroff
to disable descriptor validation, which may be useful when mitigating or recovering from catalog corruption. #90488 - CockroachDB now supports using
DROP CONSTRAINT, ADD CONSTRAINT
to add a new primary key without moving the existing primary key to a secondary index if the primary key name is a reserved SQL keyword. Previously, aconstraint already exists
error was returned. #90865 - Added the
contention_events
column to thecluster_execution_insights
table to see which transaction is blocking the specific statement. #90660 crdb_internal.scan
andcrdb_internal.list_sql_keys_in_range
return the timestamp for the time at which the value for a key was written, in addition to the raw key and value. #90956- Previously, the
AS OF SYSTEM TIME
value was set at the start of the TTL job (with a TTL cutoff - 30s), but this results in an error for TTL jobs that run longer thangc.ttlseconds
:error selecting rows to delete: ttl select defaultdb.public.events: batch timestamp 1666883527.780656000,0 must be after replica GC threshold 1666883574.542825089,0
. CockroachDB now makes theAS OF SYSTEM TIME
value relative to when eachSELECT
query is run (query time - 30s) to prevent this error from happening, but eachSELECT
query will run against a different table state. This should be ok because if records are missed during one job invocation they should still be picked up the next. #90981 - Upgrading a cluster to a major release now endow each system tenant's system database with a
descriptor_id_seq
sequence which will be used to generate new descriptor IDs, as is already the case for non-system tenants. #91205 - The
system.sql_instances
table now includes pre-allocated ID entries, where all the fields exceptid
will beNULL
. #90427 - The
to_char(timestamp, string)
function has been added. #91382 - The
to_char(interval, string)
built-in function has been added. #91382 - The
system.table_statistics
table now contains a column calledpartialPredicate
to store a predicate for a partial statistic collection. #91248 - A new
NumericStat
,idleLat
, was introduced to the statistics column ofcrdb_internal.statement_statistics
. This reports the time spent waiting for the client to send the statement while holding a transaction open. Developers may use this stat to identify opportunities for restructuring their apps to reduce contention. #91098 - The set of supported compression algorithms in compress/decompress built-in functions is expanded to include
lz4
,snappy
, andzstd
. #91162 - A new column
database
was added tocrdb_internal.{node,cluster}_queries
and list sessions endpoint. #91629 - Fixed a bug in the legacy schema changer where comments were not dropped together with the database. #91689
- The
round(decimal
) built-in function no longer returns negative 0 for any input. #86106 - Added an estimate for the number of request units consumed by a query to the output of
EXPLAIN ANALYZE
for tenant sessions. #89256 - Enabled forward indexes on arrays. #91762
- Users can now manually create partial single-column statistics at the extreme values on columns that are prefixes of their index. The output of
SHOW STATISTICS
now includes a column indicating the partial predicate for a partial statistic, orNULL
for a full statistic. #91228 - A new SQL statement
SHOW COMMIT TIMESTAMP
has been added. This statement can be used to retrieve the commit timestamp of the current explicit transaction, current multi-statement implicit transaction, or previous transaction. The statement may be used in a variety of settings to maximize its utility in the face of connection pooling. When used as a part of an explicit transaction, the statement implicitly commits the transaction internally before being able to return a causality token. #80848 - Added support for the
pg_blocking_pids
built-in function. It is hardcoded to return an empty array because CockroachDB has no equivalent concept of PIDs as in PostgreSQL. #92253 - Added a list of indexes used by the query on the statistics column on the
system.statement_statistics
andcrdb_internal.statement_statistics
tables. The format istableID@indexID
. #92351 - Added a list of used indexes (with the format
tableID@indexID
) to the sampled query telemetry log. #92464 - A new
NumericStat
,idleLat
, was introduced to the statistics column ofcrdb_internal.transaction_statistics
. It reports the time spent waiting for the client to send statements while holding a transaction open. #92695 - Added an in-memory-only evaluation of
tsvector
andtsquery
datatypes and the@@
matches operator. #90842 - Implemented the
ALTER TABLE ... ADD CHECK
statement in the declarative schema changer. #91153 - The
crdb_internal.ranges{_no_leases}
andSHOW RANGES
statements now work on secondary tenants. #92131 to_char
now has caching for parse formats, marking a speedup when runningto_char
with the same format between sessions. #91564- Casts from index name to
REGCLASS
are now supported. Previously, only table names could be cast toREGCLASS
. #90649 - Added user-defined composite column types. #90491
- SQL queries running on remote nodes now show up in CPU profiles with
distsql.*
labels. Currently this includesappname
,gateway
,txn
, and stmt. #92775 - CockroachDB now permits non-indexed storage of
tsvector
andtsquery
datatypes #92957 - Implemented the
parse_ident
built-in function, which splits a qualified identifier into an array of identifiers, removing any quoting of individual identifiers. By default, extra characters after the last identifier are considered an error; but if the second parameter isfalse
, then such extra characters are ignored. #93300
Operational changes
- Reduced the length of the
raft.process.handleready.latency
metric help text to avoid it being rejected by certain Prometheus services. #87166 - Logs produced by increasing the vmodule setting for
s3_storage
are now directed to theDEV
channel rather thanSTDOUT
. #88798 - Added observability for when load-based splitting cannot find a key to indicate the reasons why the load splitter could not find a split key, which provides more insight into why a range is not splitting easier. #88720
- Added five new fields to the
sampled_query
telemetry events:ScanCount
: Number of scans in the query plan.ScanWithStatsCount
: Number of scans using statistics (including forecasted statistics) in the query plan.ScanWithStatsForecastCount
: Number of scans using forecasted statistics in the query plan.TotalScanRowsWithoutForecastsEstimate
: Total number of rows read by all scans in the query, as estimated by the optimizer without using forecasts.NanosSinceStatsForecasted
: The greatest quantity of nanoseconds that have passed since the forecast time (or until the forecast time, if it is in the future, in which case it will be negative) for any table with forecasted stats scanned by this query. #88539
- Added a new debug tool to allow for decrypting files in a store using encryption-at-rest. This tool is intended for use while debugging, or for providing debug artifacts to Cockroach Labs to aid with support investigations. It is intended to be run "in-situ" (i.e., on site), as it prevents having to move sensitive key material. #89668
- Added a new command that can be used by an operator to list the files present in the encryption-at-rest file registry. #89873
- Release version binaries can now be instructed via the enviroment variable
COCKROACH_FORCE_DEV_VERSION
to override their cluster version support to match that of development builds, which can allow a release binary to be started in a cluster that is run (or has previously run) a development build. #90002 - The consistency check failure message is now more informative, and suggests a few actions that operators should perform in the unlikely event a failure occurs. #89899
- Updated metric descriptions of
rebalancing.*
to include the recording period. #90619 - CockroachDB now prioritizes non-voters in voter additions, meaning that when selecting a store to add a voter on (in the allocator), CockroachDB will prioritize candidate stores that contain a non-voter replica higher. This reduces the number of snapshots that need to be sent over the WAN. #89650
- CockroachDB now uses response data rather than just the request span in the load-based splitter to pass more accurate data about the keys iterated over to the load splitter to find a suitable split key, enabling the load splitter to find a split key under heavy range query workloads. #89217
- Added the
replicas.leaders_invalid_lease
metric, which indicates how many replicas are Raft group leaders but holding invalid leases. #91179 - SQL tenants now support the HTTP endpoint under
/api/v2/sql
which allows the caller to execute an HTTP request containing SQL statements to execute. The JSON response contains the results. This endpoints works identically as on a non-tenant server, except that it naturally scopes to the target tenant for SQL execution. #91323 - The cluster settings
server.web_session.purge.period
andserver.web_session.purge.max_deletions_per_cycle
, which were specific to the cleanup function forsystem.web_sessions
, have been replaced byserver.log_gc.period
andserver.log_gc.max_deletions_per_cycle
which apply to the cleanup function forsystem.eventlog
,system.rangelog
andsystem.web_sessions
equally. #90789 - The cluster setting
server.web_session.auto_logout.timeout
has been removed. #90789 - Generating a
debug.zip
for a tenant server will now include logs in the ZIP file. #91604 - Splunk dashboard templates are available in the public repository under
/monitoring/splunk-dashboard/
. #92330 - The network timeout for RPC connections between cluster nodes has been reduced from 3 seconds to 2 seconds, with a connection timeout of 4 seconds, in order to reduce unavailability and tail latencies during infrastructure outages. This can now be changed by setting the
COCKROACH_NETWORK_TIMEOUT
environment variable, which defaults to2s
. #92542 - The Raft election timeout has been reduced from 3 seconds to 2 seconds, and the lease interval from 9 seconds to 6 seconds, with a corresponding reduction in the node heartbeat interval from 4.5 seconds to 3 seconds. This reduces the period of unavailability following leaseholder loss, but places tighter restrictions on network latencies (no more than 500ms roundtrip time). This can be adjusted by setting the
COCKROACH_RAFT_ELECTION_TIMEOUT_TICKS
environment variable, which now defaults to 10 and will scale all of these intervals proportionally. #91947 - The RPC heartbeat and gRPC keepalive ping intervals have been reduced to 1 second to detect failures faster. This is adjustable via the new
COCKROACH_PING_INTERVAL
environment variable. The timeouts remain unchanged. #93399
Command-line changes
- The interactive SQL shell now retains a maximum of 1000 entries. There was no limit previously. #88173
- The deprecated CLI command
debug unsafe-remove-dead-replicas
has been removed. Usedebug recover
instead. #89150 - The
\df
metacommand was added to the SQL shell, which will list all user-defined functions in the current database. #89557 - In the
kv
workload, you can now enable--splits
with the--sequential
flag and adjust splitting to uniformly partition the keyspace. #90000 - Added the
--insert-count
flag to insert rows before thekv
workload begins. #90055 - CockroachDB will now include recommended remediation actions alongside log messages for some errors. #82891
- The input syntax of
\set
is now more flexible: it is now more accepting of space characters in various positions of the syntax and it supports quoted values, e.g., via\set prompt1 "a b c"
. #90520 cockroach demo --global
will now start up more quickly. The latency that will be injected will not be injected until after the initial cluster is set up internally. #92231- The engine used as line editor in the interactive shell (
cockroach sql
andcockroach demo
) has been updated. It includes numerous bug fixes and new features. The previous engine can still be accessed by setting theCOCKROACH_SQL_FORCE_LIBEDIT
environment variable to true. This support will be removed in a later version. #86457 - The interactive SQL shell now supports an advanced debug mode for troubleshooting when
--debug-sql-cli
is specified on the command line. The debug mode can be enabled with Ctrl+@ or Ctrl+_ (Ctrl+space on macOS). #86457 The following fields have been redacted and were added to the redacted debug zip:
crdb_internal.create_statements
:create_statement
create_nofks
alter_statements
(each element is redacted)
crdb_internal.create_function_statements
:- c
reate_statement
- c
crdb_internal.{node,cluster}_distsql_flows
:stmt
crdb_internal.{cluster,node}_sessions
:last_active
active_queries
crdb_internal.{cluster,node}_queries
:query
#92263
The interactive SQL shell now supports a rudimentary form of tab completion to input the name of SQL objects and functions. #87606
The command-line flag
--empty
tocockroach demo
is not marked as deprecated anymore; it is more convenient than--no-example-database
. However, the latter remains supported as an alias. #93255The command-line flags
--logtostderr
,--log-file-verbosity
,--no-color
,--redactable-logs
,--log-file-max-size
,--log-group-max-size
,--log-dir
,--sql-audit-dir
are not marked as deprecated anymore; instead, they are defined as convenience aliases for various--log
specifications. #93255cockroach demo
now supports--pid-file
for symmetry withcockroach start
. #93343The debug utility script
hot-ranges.sh
partitions output by statistics:queries_per_second
,writes_per_second
,read_bytes_per_second
,write_bytes_per_second
. It also decreased the number of ranges shown under each heading from 20 to 10. #93528
DB Console changes
- The High Contention Time insight description now accurately reflects the event's contention duration in the DB Console. #89035
- Overview and Explain Plan tabs were added to the Active Statement Details page. #89021
- The Apply button was added on the Table Details page (DB Console only) when there is a recommendation to drop an unused index. #90070
- Overview and Explain Plan tabs were added to the Statement Insight Details page. #90250
- The Jobs Page now includes a column picker. #89678
- The fingerprint ID values for statements and transactions on the Insights pages are links that open the respective details page on the time period of the execution of that statement or transaction. #90403
- Requests to fetch table and database statistics now have limited concurrency. This may make loading the Databases page slower, but in return should result in making those pages less disruptive. #90210
- The Transaction filter label on the SQL Activity page was fixed. #91255
- The metric graph tooltip styling was fixed to prevent content collapse. #91290
- Index recommendations were added to the Statement Active Execution Details page, and the plan gist was added as the first line of the explain plan. #91629
- Transaction insights pages now show insights about slow execution with unknown causes, index recommendations, and failed executions. The following fields have also been added on the Details page, but are not available for transactions where the insight is "High Contention" (i.e., user name, session ID, rows processed, rows read, rows written, retries, last retry reason, full scan, and transaction priority). #91698
- The fingerprint ID in hex format was added to the Statement Details page and Transaction Details page. #91885
- The contention time, schema, database, table, and index info was added to the Insights Statement Details page. #91668
- The query column in the insight recommendations table was removed. Instead, the statement is included in the description if the transaction being reported has multiple statements. #91955
- Graphs on the Metrics page now downsample using max value instead of average. Previously, zooming out on a graph would cause any spikes in the graph to smooth out, potentially hiding anomalies. These anomalies are now visible even when looking at a zoomed out interval. #92017
- The Statement Execution and Planning Time chart on the Statement Fingerprint page now includes a third value ("Idle") representing the time spent by the application waiting to execute this statement while holding a transaction open. #92284
- A list of used index per explain plan was added, under the Explain Plan tab on the Statement Details page, with links to the table or index details pages. #92463
- The Insights pages in the DB Console now show the seconds and milliseconds for all timestamp values. #92571
- Links were added on the fingerprint ID in the High Contention table on the Transaction Insights Details page. #92612
- The following new charts were added to the Metrics page, under SQL view: Service Latency: SQL Statements, 99.9th percentile and Service Latency: SQL Statements, 99.99th percentile. #92591
- Renamed the chart on the Statement Details page from Statement Execution and Planning Time to Statement Times. #92765
- The Transaction resource usage card on the Transaction Fingerprint page now includes an "Idle latency" row, representing the time spent by the application performing other work while holding this transaction open. #92951
- The Databases table page now displays all the grants in a single row per user. #92871
- Added a goroutine scheduling latency graph to the Overload dashboard in the DB Console. It shows what the per-node p99 scheduling latency is for goroutines. #93217
- Added a top-level dropdown in the DB Console which lists tenants the user has logged into. If the cluster is not a multi-tenant host, the dropdown is not displayed. #92694
- CockroachDB now prevents polling
/settings
,/nodes_ui,
and/cluster
endpoints on incorrect login. #93211 - The Statement and Transaction pages for tenant clusters gained region columns and filters for multi-region tenants. #92357
Bug fixes
- The flag
--sql-advertise-addr
now properly works even when the SQL and RPC ports are shared (because--sql-addr
was not specified). Note that this port sharing is a deprecated feature in v22.2. #87412 - Fixed a bug introduced in v21.2 that could cause an internal error in rare cases when a query required a constrained index scan to return results in order. #87562
- Fixed a bug that existed from before v21.1 that could cause an internal error when executing a query with a limit ordering on the output of a window function. #87320
- Fixed an incorrect default value of
cloudstorage.gs.chunking.retry_timeout
to 60 seconds #87817 - Fixed a bug in
pg_catalog
tables that could result in an internal error if a schema is concurrently dropped. #88568 - Fixed a bug that caused
ALTER CHANGEFEED
to fail if the changefeed was created with a cursor option and had been running for more thangc.ttlseconds
. #88402 - Fixed a bug that could cause a panic when running a query with
EXPLAIN
that attempts to order on a non-output column. #88441 - Fixed missing automatic statistics collection at cluster startup when the
sql.stats.automatic_collection.enabled
cluster setting is false, but there are tables with the storage parametersql_stats_automatic_collection_enabled
set to true. #88673 - Fixes an issue where when a statement bundle was collected for a query that results in an error due to a
statement_timeout
, the bundle would not be saved. #88080 - CockroachDB now excludes check constraints of hash-shared indexes from being invalidated when executing
IMPORT INTO
. #89231 - CockroachDB now flushes WAL when writing storage checkpoints on consistency checker failures. #89369
- Fixed optimizer selectivity and cost estimates of zigzag joins in order to prevent query plans from using it when it would perform poorly (e.g., when many rows are qualified). #89261
- Changefeeds will now never permanently error on a "failed to send RPC" error. #87763
- Fixed a bug that could occur when dropping a role that owned two schemas with the same name in different databases. The bug was introduced in v22.1.0. #89504
- CockroachDB now avoids a source of internal connectivity problems that would resolve after restarting the affected node. #89539
- CockroachDB now shows the correct value on table stats on UI, when there are no values to show. #89867
- Charts on the Statement Details page in the DB Console are no longer overlapping. #90014
- It is now possible to create tables, views, columns, etc. with the name
nothing
(e.g.,CREATE TABLE nothing...
) without having to quote the name, like in PostgreSQL. This bug was introduced in CockroachDB v2.0. #89903 - Fixed detection and erroring out of queries using locality-optimized joins when the session setting
enforce_home_region
is true and the input table to the join has no home region or its home region does not match the gateway region. #90107 - Fixed an issue with the
enforce_home_region
session setting which may causeSHOW CREATE TABLE
or other non-DML statements to error out if the optimizer plan for the statement involves accessing a multi-region table. #90007 - Fixed a bug in
changefeed.batch_reduction_retry
which resulted in only a single level of retry being able to occur. #90153 - During JWT based auth, CockroachDB now infers the algorithm type if it is not specified by the JWKS. This enables support for a wider range of keys. #89989
- Fixed an extremely rare out of bounds crash in the protected timestamp subsystem. #90357
- Fixed the calculation of the
pg_attribute.attnum
column for indexes so that theattnum
is always based on the order the column appears in the index. Also fixed thepg_attribute
table so that it includes stored columns in secondary indexes. #90287 - Fixed a bug in the DB Console where when the height of the filter was big, you had to scroll to get to the Apply button. #90457
- Fixed a bug in the DB Console to now send the proper start and end values to the endpoint used on the SQL Activity page so it returns the full hour as described on the UI. #90403
- Fixed a rare bug where concurrent follower read/split operations could lead to invalid read results. #89886
- Fixed a bug that could cause
UPDATE .. FROM
clauses to update the same row multiple times, resulting in incorrectUPDATED
row counts and duplicate output rows for statements with aRETURNING
clause. The bug only appeared when the target table had a hidden primary key column (e.g., an implicitrowid
primary key column). The bug has been present since support forUPDATE .. FROM
was added in v19.0. #89780 - Protected timestamps are now created during index validation. Before, index validation could be starved if it took longer than any GC jobs for a given table. #89540
- Fixed a bug where
SELECT *
operations on tables with virtual computed columns undergoing schema changes could potentially fail. #90670 - Fixed a bug where in large, multi-region clusters it was possible for the leasing mechanism used for jobs to get caught in a live-lock scenario whereby jobs could not be adopted. #90875
- CockroachDB now ensures changefeeds shut down when one of the aggregator nodes returns an error. #90767
- Fixed a bug the occurred when attempting to reduce the size of a fixed-size
VARCHAR
column. #91078 - Fixed a bug that caused ranges to remain without a leaseholder in cases of asymmetric network partitions. #87244
- Fixed a bug that would prevent data from a failed restore from being cleaned up quickly. #88342
- Fixed a bug which, in rare cases, could result in a changefeed missing rows which occur around the time of a split in writing transactions which take longer than the closed timestamp target duration (defaults to 3s). #91116
- Fixed a bug where point lookups on the
pg_catalog.pg_type
table would fail to find the implicit record type that gets created for tables in thepg_catalog
,information_schema
, andcrdb_internal
schemas. #90924 - Fixed a bug that prevented the usage of implicit record types for tables in the
pg_catalog
,information_schema
, andcrdb_internal
schemas. #90924 - Fixed a bug that could result in transient errors when dropping a database and immediately recreating a database with the same name and connecting to it for use. #91174
- Fixes a bug that resulted in the regions listed for databases and tables including an incorrect list of regions due to the logic including information about tables which are adjacent in the keyspace. #91130
- Fixed a bug where the experimental
scrub
command did not handle type descriptors in the database. #91085 - Fixed a panic that could occur when calling
st_distancespheroid
orst_distancesphere
with a spatial object containing anNaN
coordinate. This now produces an error, with the message "input is out of range". #90218 - Fixed a bug that could result in infrequent progress updates for very large backup or restore jobs. #89971
- Added leading zeros to fingerprint IDs with less than 16 characters. #91885
- Fixed a bug causing changefeeds to fail when a value is deleted while running on a non-primary column family with multiple columns. #91870
- Fixed a bug that existed since before v21.1 where the
cgroup
memory limit was undetected when usingsystemd
. #91789 - Fixed a bug that existed since v20.2 that could cause incorrect results in rare cases for queries with inner joins and left joins. #91425
- Fixed an unhandled error that could happen if
ALTER DEFAULT PRIVILEGES
was run on the system database. #92075 - CockroachDB now prevents schema changes on the
crdb_internal_expiration
table. #91720 - When configured to true, the
sql.metrics.statement_details.dump_to_logs
cluster setting no longer causes a mutex deadlock. #92272 - Fixed a bug that could lead to errors when running multiple schema change statements in a single command using a driver that uses the extended pgwire protocol internally (for example the Npgsql C# driver). The error messages was "attempted to update job for mutation 2, but job already exists with mutation 1". #92300
- Fixed the Statement Activity page so that it no longer shows multi-statement implicit transactions as "explicit." #92408
- Server crashes that occur during startup are now more clearly reported in logs and the standard error output. #91823
- Fixed incorrect cancellation logic when attempting to detect stuck rangefeeds. #92582
- Fixed an internal error when comparing a tuple type with a non-tuple type. #92635
- Fixed incorrect selectivity estimation for queries with
OR
predicates all referencing a common single table. #89358 - Added sort setting to tables on the Transaction and Statement Insights Details pages. #92573
- Fixed an issue where
changefeed.emitted_messages
would be increased twice per message for changefeed cloud storage sinks. #92685 - Fixed a bug where
attidentity
inpg_attribute
for theGENERATED BY DEFAULT AS IDENTITY
column should bed
. #92545 - CockroachDB previously could incorrectly evaluate queries that performed left semi and left anti "virtual lookup" joins on tables in
pg_catalog
orinformation_schema
. These join types can be planned when a subquery is used inside of a filter condition. The bug was introduced in v20.2.0 and is now fixed. #92713 - Fixed a link to index details on the Drop Index Insights in the Cloud Console. #92953
- Fixed a bug where encoding of
ARRAY
type to Parquet format would fail in some cases during theEXPORT
command. #92948 - Fixed a rare panic only present in v22.2.0 that occurs when using particular forms of existing statistics in table statistics forecasting. #92707
- In the presence of several backup files, CockroachDB now speeds up slow listing calls that could manifest as restore queries hanging during execution. #93072
- Prepared statements that use type hints can now succeed type-checking in more cases when the placeholder type is ambiguous. #92834
- Fixed a bug where glob patterns that matched no tables in
GRANT
orREVOKE
statements would return an internal error with a confusing message as opposed to the appropriate "no objects matched" error. #93173 - Fixed a bug where empty
COPY
commands would not escape after an EOF character or error if encountering a\.
with no input. #93100 - Fixed a bug where in PostgreSQL extended protocol mode it was possible for auto-commits to not execute certain logic for DDL, when certain DML (insert/update/delete) and DDL were combined in an implicit transaction. #93283
- Fixed the
pg_table_is_visible
built-in function so it correctly reports visibility of indexes based on the currentsearch_path
. #90649 - Fixed a bug that would result in incomplete backups when non-default, non-public resource limiting settings (
kv.bulk_sst.max_request_time
oradmission.elastic_cpu.enabled
) were enabled. #92825 - The
pg_function_is_visible
function now correctly reports visibility based on the functions that are visible on the currentsearch_path
. #90657 - Fixed a rare bug that could cause upgrades from v22.1 to v22.2 to fail if the job coordinator node crashes in the middle of a specific upgrade migration. #93487
- Fixed a bug for queries with disjunctions (i.e., contains
OR
) where all the columns referenced in the disjunctions are known to have a single value. #93480 - Fixed a bug introduced in v22.1.0 in which the non-default nulls ordering,
NULLS LAST
, was ignored in window and aggregate functions. This bug would cause incorrect query results whenNULLS LAST
was used. #93426 - Fixed a bug that caused an internal error when trying to execute a UDF with an empty function body. This bug was present since UDFs were introduced in v22.2.0. #93331
- Fixed an issue where
DISTINCT ON
queries would fail with the error "SELECT DISTINCT ON expressions must match initial ORDER BY expressions" when the query included anORDER BY
clause containingASC NULLS LAST
orDESC NULLS FIRST
. #93567 - Fixed a bug where selecting a small timeframe in the past in a timeseries query resulted in no data in the graphs. #93293
- Fixed a bug where CockroachDB would error when receiving Geometry/Geography using binary parameters. #93563
- Fixed an internal error that could occur when comparing a column of type void to
NULL
usingcol IS NULL
orcol IS NOT NULL
. #93652 - Fixed a bug where a query would incorrectly pass if a given interval for
AS OF SYSTEM TIME
interval was a small positive duration. #93146
Performance improvements
- The optimizer will now plan inverted index scans for queries with JSON subscripting filters, like
json_col['field'] = '"value"
. #87957 - CockroachDB now avoids wasteful contention on the gossip mutex caused by checking if the network needs tightening hundreds of times per second. #88472
- Some types of queries with comparisons with constant values now execute faster. #88638
- The optimizer now explores plans with a single lookup join expressions in rare cases where it previously planned two lookup join expressions. #88491
- Consistency checks are now properly cancelled on timeout, preventing them from piling up. #86591
- Raft ticks now adapt to scheduling delays. This helps preventing re-elections, and the corresponding performance effects, in the event of relatively short (sub-second) processing delays. #86240
- HTTP requests with
Accept-encoding: gzip
previously resulted in valid GZIP-encoded, but uncompressed, responses. This resulted in inefficient HTTP transfer times, as far more bytes were transferred than necessary. Those responses are now properly compressed, resulting in smaller network responses. #88950 pg_catalog.col_description
is now much faster when resolving columns for tables in thepg_catalog
,crdb_internal
, orinformation_schema
namespaces. #89465- The optimizer now does less copying of histograms while planning queries, which will reduce memory pressure a little. #88526
- Added early inlining of
VALUES
clauses and unnested arrays inWITH
queries in order to eliminate unnecessary joins. #87790 - Added significantly faster JSON parsing, which should help with any workloads that insert large amounts of JSON data, including
IMPORT
workloads. #89884 - Loading the Database Details page in the DB Console is now somewhat less expensive when there are a large number of databases and a large number of tables in each database and a large number of ranges in the cluster. #90198
- Tables in
pg_catalog
andinformation_schema
(when not explicitly referenced as"".information_schema
) may now be much faster if the current database has a small number of relations relative to the total number in the cluster. #90116 - The overhead of running
EXPLAIN ANALYZE
andEXPLAIN ANALYZE (DISTSQL)
has been significantly reduced. The overhead ofEXPLAIN ANALYZE (DEBUG)
did not change. #91117 - Enabled more efficient lookup joins by deriving new join constraints when equijoin predicates exist on the column(s) of a unique constraint on one table which are a proper subset of the referencing columns of a foreign key constraint on the other table. If an index exists on those foreign key constraint referencing columns, equijoin predicates are derived between the primary key and foreign key columns not currently bound by
ON
clause predicates. #90599 - The setup of the distributed query execution is now fully parallelized which should reduce the query latencies, especially in multi-region setups. #89649
- Performance of the
LIKE
andILIKE
operators using patterns without any wildcards has been improved. #91895 - The optimizer can now better calculate the properties of recursive common table expressions in the presence of a
LIMIT
. #90725 - Certain types of reads will now have a far smaller contention footprint with conflicting concurrent writers. #85993
- In some cases, the key-value store client now needs to look up where to send requests. Prior to this change, such lookup requests were always routed to the leaseholder of the metadata range storing that information. Now the client can attempt to look up this metadata from followers. This can improve tail latency in multi-region clusters in cases where the range addressing cache is cold. #91638
- The garbage collection score triggering a MVCC GC run has been lowered. The GC Score is a ratio computed from MVCC stats and uses the ratio of live objects and estimated garbage age to estimate collectability of existing data. The reduced score will trigger garbage collection earlier, lowering the interval between runs 3 times, giving 2 times reduced peak garbage usage at the expense of 30% increase of wasteful data scanning on constantly updated data. #92118
- CockroachDB in some cases now correctly incorporates the value of the
OFFSET
clause when determining the number of rows that need to be read when theLIMIT
clause is also present. Note that there was no correctness issue here, only that extra unnecessary rows could be read. #92779 - In 22.2, privileges on virtual tables (system catalogs like
pg_catalog
,information_schema
, andcrdb_internal
) were introduced. A problem with this new feature is that we now must fetch those privileges into a cache before we can use those tables or determine their visibility in other system catalogs. This process used to occur on-demand, when the privilege was needed. Now, CockroachDB will fetch these privileges eagerly during startup to mitigate latency when accessingpg_catalog
right after the server boots up. #93557
Contributors
This release includes 1655 merged PRs by 101 authors.
We would like to thank the following contributors from the CockroachDB community:
- Alex (first-time contributor)
- Ambuj Kumar (first-time contributor)
- Faizaan Madhani (first-time contributor)
- GirishV (first-time contributor)
- Klaus Rettinghaus (first-time contributor)
- Vivian Kong (first-time contributor)
- e-mbrown
- likzn
- nnaka2992
- quanuw (first-time contributor)
- rharding6373
- shralex