Skip to content

opt: remove unnecessary columns from constrained scans #75153

@RaduBerinde

Description

@RaduBerinde

A constrained scan operator always returns the constrained columns, even when they are not needed, eg:

• group (scalar)
│ columns: (min int)
│ estimated row count: 1 (missing stats)
│ aggregate 0: any_not_null(x)
│
└── • project
    │ columns: (x int)
    │
    └── • scan
          columns: (x int, y int, z float)
          estimated row count: 1 (missing stats)
          table: xyz@zyx
          spans: /3/2-/3/3
          limit: 1

This is unnecessary and could be fixed by an xform rule or in the execbuilder.

Jira issue: CRDB-12491

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