Skip to content

sql: use Gets in lookup and index joins whenever possible #108489

@yuzefovich

Description

@yuzefovich

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

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions