Currently, tree.NotExpr is not implemented natively in the vectorized engine, so we have to fallback to the older row-by-row engine to evaluate it. We should, instead, vectorize NotExpr.
I think the implementation will be quite similar to how tree.IsNullExpr is implemented, and I think we will want to implement two versions of NotExpr operator:
- one for projections, which populates a
coldata.Vec with values equal to evaluating NOT predicate on each row in another coldata.Vec (while paying attention to nulls in the input vector and the selection vector on the input batch)
- one for selections, which updates the selection vector on the batch to include only rows for which
NOT predicate evaluated to true.
Some code pointers:
- the planning is done in
colbuilder/execplan.go in planProjectionOperators and planSelectionOperators
tree.NotExpr lives in sem/tree/expr.go
- the vectorized implementation of
tree.IsNullExpr lives in colexec/is_null_ops.eg.go (which is automatically generated based on colexec/is_nulls_ops_tmpl.go and colexec/execgen/cmd/execgen/is_nulls_ops_gen.go).
Please let me know if more guidance is needed.
Jira issue: CRDB-10187
Currently,
tree.NotExpris not implemented natively in the vectorized engine, so we have to fallback to the older row-by-row engine to evaluate it. We should, instead, vectorizeNotExpr.I think the implementation will be quite similar to how
tree.IsNullExpris implemented, and I think we will want to implement two versions ofNotExproperator:coldata.Vecwith values equal to evaluatingNOTpredicate on each row in anothercoldata.Vec(while paying attention to nulls in the input vector and the selection vector on the input batch)NOTpredicate evaluated totrue.Some code pointers:
colbuilder/execplan.goinplanProjectionOperatorsandplanSelectionOperatorstree.NotExprlives insem/tree/expr.gotree.IsNullExprlives incolexec/is_null_ops.eg.go(which is automatically generated based oncolexec/is_nulls_ops_tmpl.goandcolexec/execgen/cmd/execgen/is_nulls_ops_gen.go).Please let me know if more guidance is needed.
Jira issue: CRDB-10187