What's New in v20.2.14

Cockroach Labs will stop providing Assistance Support for this version on May 10, 2022. Prior to that date, upgrade to a more recent version to continue receiving support. For more details, see the Release Support Policy.

August 16, 2021

Get future release notes emailed to you:


The CockroachDB executable for Windows is experimental and not suitable for production deployments. Windows 8 or higher is required.

Docker image

$ docker pull cockroachdb/cockroach:v20.2.14

Security updates

Enterprise edition changes

  • Incremental backups to a cloud storage location that already contains large existing backups now find their derived destination without listing as many remote files. #67289

SQL language changes

  • Added a new EXPLAIN flag, MEMO, to be used with EXPLAIN (OPT). When the MEMO flag is passed, a representation of the optimizer memo will be printed along with the best plan. The MEMO flag can be used in combination with other flags such as CATALOG and VERBOSE. For example, EXPLAIN (OPT, MEMO, VERBOSE) will print the memo along with verbose output for the best plan. #67778

DB Console changes

  • The DB Console will now redirect the user to the originally requested page after user login. #67859

Bug fixes

  • Fixed a statement buffer memory leak when using suspended portals. #67370
  • Correlated subqueries that couldn't be decorrelated and that have their own subqueries are now executed correctly when supported. Note that this is a very rare edge case. #67571
  • Fixed a very rare unexpected error from the vectorized engine ("index out of bounds") when evaluating the CASE operator. #67785
  • Catching up Raft followers on the Raft log is now more efficient in the presence of many large Raft log entries. This helps avoid situations where Raft leaders struggle to retain leadership while catching up their followers. #67126
  • Fixed a rare bug when a lease change occured during a range merge. This bug allowed AS OF SYSTEM TIME queries to serve inconsistent results. #65823
  • The v20.2 SQL shell now properly reports detailed execution timings (using the client-side configuration setting verbose_times) when run against a v21.1+ server. #67853
  • Fixed a deadlock that could occur when many replicas were rapidly queued for removal. #65861
  • Fixed two bugs which affected geospatial queries with the st_distance function. The first caused errors for filters of the form st_distance(g1, g2, use_spheroid) = 0. The second incorrectly transformed filters of the form st_distance(g1, g2) = 0 when g1 and g2 are geographies to st_instersects(g1, g2). This is not a valid transformation because st_distance makes spheroid-based calculations by default while st_intersects only makes sphere-based calculations. #67412
  • Fixed an issue with statistics estimation in the optimizer that could have caused it to over-estimate the number of rows for some expressions and thus choose a sub-optimal plan. This issue could happen when multi-column statistics were used in combination with histograms, the query contained a predicate on two or more columns where the columns were hightly correlated, and the selected values were very common according to the histograms. #68012
  • Fixed an issue where CockroachDB could encounter an internal error or crash when performing a cast of a NULL JSON value to Geography or Geometry types. #67903
  • INSERT and UPDATE statements which operate on larger rows are now split into batches using the sql.mutations.mutation_batch_byte_size setting. #67963
  • Fixed a rare bug that could result in a crash while creating a debug.zip. The bug would only occur if a debug.zip was captured during a period of rapid lease movement. #67727
  • Fixed a rare crash when a backup writing to Google Cloud Storage failed while writing a file. #68258
  • Fixed missing foreign key checks in some cases when there are multiple checks and the inserted data contains a NULL for one of the checks. #68521
  • Fixed a bug that prevented upreplication of an underreplicated range while in a joint quorum configuration. #68576

Performance improvements

  • Improved the selectivity estimate for array containing predicates (for example, arr @> ARRAY[1]) in the optimizer. This improves the optimizer's cardinality estimation for queries containing these predicates, and may result in better query plans in some cases. #67530
  • Updated the cost model in the optimizer to make index joins more expensive and better reflect the reality of their cost. As a result, the optimizer will choose index joins less frequently, generally resulting in more efficient query plans. #67530
  • Improved the performance of the pg_table_is_visible builtin function. #68113


This release includes 35 merged PRs by 22 authors. We would like to thank the following contributors from the CockroachDB community:

  • joesankey (first-time contributor)
YesYes NoNo