sql/sem/normalize: remove ConstantEvalVisitor
sql/rowexec: handle re-parsed lookup expressions in join reader
Previously, the join reader relied on the normalize.ConstantEvalVisitor
used in execinfrapb.DeserializeExpr to convert tuples in serialized
lookup expressions from *tree.Tuples to *tree.DTuples. This commit
break this reliance.
Release note: None
sql/sem/normalize: remove ConstantEvalVisitor
The ConstantEvalVisitor was introduced in #30216 as a work around for
a poorly performing type of query. It turned an ARRAY AST node with
all constant children into a DArray. The optimizer now performs this
optimization in the execbuilder phase. To be sure this is no longer
needed, I ran several queries similar to the original motivating
examples and saw no measurable performance difference.
Epic: None
Release note: None
A classic 5 year "temporary fix" finally addressed. cc @RaduBerinde.
@DrewKimball I added a new commit to address one assumption in the join reader that broke because of this. PTAL.
Hmm I wonder if this could cause a regression in the row-based engine in the case that a filter like i IN (1 , 3, …) is pushed to another node.
I re-tested this and it did cause a significant regression when evaluating a distributed filter like in SELECT * FROM t WHERE a IN (1, 2, 3, 4, ..., 9999);. Closing.