> ## Documentation Index
> Fetch the complete documentation index at: https://www.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Technical Advisory 74385

Publication date: January 6, 2022

## Description

Partial indexes can be corrupted by `UPDATE` statements, resulting in incorrect query results for any queries that use the partial index. Corruption can occur only under the following conditions:

* A table must have two or more partial indexes, unique or non-unique, with identical `WHERE` clauses.
* An `UPDATE` must be issued to the table which updates a column(s) included in one of the indexes but not another.

CockroachDB versions 21.1 and 21.2 are affected by this bug until maintenance versions 21.1.13 and 21.2.4.

## Statement

The fix has been applied to maintenance versions 21.1.13 and 21.2.4 of CockroachDB.

## Mitigation

Users of CockroachDB are encouraged to upgrade to a maintenance version with the fix applied. Once the upgrade is complete, all partial indexes should be dropped and recreated to ensure that no indexes remain corrupt.

To avoid the issue without upgrading, users should remove or alter the `WHERE` clause of partial indexes such that no table has two or more partial indexes with the same `WHERE` clause. Be aware that removing or altering unique partial indexes can change their uniqueness guarantees.

## Impact

Partial indexes in the same table with identical `WHERE` clauses can become corrupt and cause incorrect query results.

Please reach out to the [support team](https://support.cockroachlabs.com/) if you need more information or assistance.
