thingtalk icon indicating copy to clipboard operation
thingtalk copied to clipboard

Optimization for existential subquery

Open sileix opened this issue 3 years ago • 0 comments

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

sileix avatar Mar 01 '21 23:03 sileix