cockroach
cockroach copied to clipboard
opt: introduce memo.ExistsPrivate and add lazy projection column
opt: introduce memo.ExistsPrivate and add lazy projection column
This commit introduces the memo.ExistsPrivate struct, which wraps the
memo.SubqueryPrivate struct. This new private struct has a column that
is used during the execbuilder phase if the Exists subquery is planned
as a lazily-evaluated routine. By adding this column to the Exists
expression, we can avoid the anti-pattern of creating a new column ID in
the execbuilder. This will be beneficial in future commits in which
execbuilder will rely on knowing the maximum column ID for a query plan
before it begins constructing execution nodes.
Release note: None
opt: move WasLimited from SubqueryPrivate to ExistsPrivate
The WasLimited field is only used for Exists subqueries, so it has
been moved from SubqueryPrivate to ExistsPrivate.
Release note: None
opt: remove IntroduceExistsLimit rule
This rule has been superseded by the
ConvertUncorrelatedExistsToCoalesceSubquery rule. Since that rule was
introduced, IntroduceExistsLimit should have never matched.
Release note: None
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
This change is a prerequisite for the changes in #119095.
The diff is quite large, but most of it is changes to column IDs in optimizer tests. I'm happy to walk through all the changes if that'd be helpful.
TFTR!
bors r+