-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: use Gets in lookup and index joins whenever possible #108489
Copy link
Copy link
Closed
Labels
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 evaluating the lookup joins if LookupColumnsAreKey is set, I believe it'd be valid to use Get requests for tables with a single column family in all cases. In particular, currently if we're looking up into the secondary non-UNIQUE index, we issue a Scan request, but given lookup columns form a key, we know that the lookup will result in at most one KV, so I believe it'd be safe to use a Get request.
We should also audit the index join in case we can use Get requests in more cases there too.
We should think through whether presence of NULLs would affect this proposal.
Jira issue: CRDB-30490
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
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