Existential subqueries can be optimized as operations like sorting won't affect the value of the boolean expression.
Operations that have effect:
- filter
- projection: the output parameter could be optional, the semantics is at least one row has all projections are not
null or undefined.
- aggregation: similar to projection, as long as the fields used are not
null or undefined, this should be true, so this can probably be optimized to projection.
- slice: the semantics is at least any of x rows are returned, where x is the length of the slice
Operations that have no effect:
- sort
- index
- argmin/argmax
- alias
Existential subqueries can be optimized as operations like sorting won't affect the value of the boolean expression.
Operations that have effect:
nullorundefined.nullorundefined, this should be true, so this can probably be optimized to projection.Operations that have no effect: