opt: support multiple arbiter indexes for INSERT ON CONFLICT DO UPDATE #53170
Labels
A-partial-indexes
Relating to partial indexes.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
docs-done
docs-known-limitation
T-sql-queries
SQL Queries Team
X-anchored-telemetry
The issue number is anchored by telemetry references.
We currently do not support multiple arbiter indexes for
INSERT ON CONFLICT DO UPDATE
.Postgres:
CockroachDB:
Workaround
The current workarounds are to:
ON CONFLICT WHERE
clause more strict so that it only matches a single unique index.ON CONFLICT WHERE
clause.Notes
In order to do this, we'll have to loop through all arbiter indexes and left-join them together to build a composite canary column that dictates whether a row should be inserted or updated. This is similar to what is done for
INSERT ON CONFLICT DO NOTHING
with the added complexity of the canary column.Jira issue: CRDB-3894
The text was updated successfully, but these errors were encountered: