opt, sql: parallelize uniqueness checks when possible #58942
Labels
A-multiregion
Related to multi-region
A-sql-execution
Relating to SQL execution.
A-sql-optimizer
SQL logical planning and optimizations.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
T-multiregion
Currently, uniqueness checks are run after a mutation completes, as a series of post-queries (similar to foreign key checks). We could reduce latency by parallelizing all of these checks. It may also be possible to run the uniqueness checks in parallel with the mutation itself. If the mutation only affects a single row, the uniqueness check can be trivially parallelized with the mutation (particularly if the mutation is an
INSERT
withVALUES
input). If it affects multiple rows, it may or may not be possible to parallelize. This is also relevant for enabling the insert fast path with uniqueness checks, as described in #58047.cc @nvanbenschoten @andreimatei
Epic CRDB-26292
Jira issue: CRDB-3356
The text was updated successfully, but these errors were encountered: