-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: add hint to ignore preserved-multiplicity consistency #83156
Copy link
Copy link
Closed
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Description
When SELECT FOR UPDATE SKIP LOCKED queries execute, they could encounter two forms of inconsistency we don't see during normal query execution:
- We might not read a PK row for every secondary index row.
- We might not read a FK row for every referenced FK.
The optimizer depends on these assumptions in a few places, for example in the filtersMatchAllLeftRows function, and in the PushLimitIntoIndexJoin rule.
We should add a hint to the optimizer, similar to IGNORE_FOREIGN_KEYS, which tells it to disable rules that depend on these consistency assumptions. Then we can add this hint to SELECT FOR UPDATE SKIP LOCKED queries.
Jira issue: CRDB-16891
Epic: CRDB-16932
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Done