cockroachdb / cockroachdb/cockroach

opt: hoist an uncorrelated subquery multiple times

Open
#115,334 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

In #115142, we limited the optimizer from hoisting an instance of an uncorrelated subquery more than once. This was done to prevent the possibility of producing expressions with child expressions that produce the same column IDs (see #114703). A downside of this limitation is that it could prevent the optimizer from producing an optimal query plan in some cases.

It may be possible to lift this restriction by generating new columns IDs for the subquery's sub-expression each time it is hoisted.

Jira issue: CRDB-33984

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.