-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: remove unnecessary columns from constrained scans #75153
Copy link
Copy link
Open
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
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
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
Backlog