Skip to content

sql: virtual table constrained scan #74806

@Azhng

Description

@Azhng

Is your feature request related to a problem? Please describe.

Currently, there's no way perform an efficient constrained scan virtual table. That means, if a virtual table utilizes a regular SQL table under the hood, there's no way for the virtual table to utilize the indexes from the underlying SQL table, resulting in the bad bad query plans where SQL engine performs full table scan. This becomes more problematic if the sorting is involved which result in a small query fall back to disk spilling sort. E.g. #74680 #71245

Describe the solution you'd like
The virtual table generator / populate hook should have the predicate information in order to make smarter decisions.

Jira issue: CRDB-12275

Epic CRDB-14840

Metadata

Metadata

Assignees

No one assigned

    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

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions