[
https://issues.apache.org/jira/browse/CALCITE-2451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16622369#comment-16622369
]
Vladimir Sitnikov commented on CALCITE-2451:
--------------------------------------------
{quote} Previously when RexSimplify looked at an expression that was already
simplified, it would do close to zero object allocations when it returned the
same result{quote}
That is not right.
RexSimplify does crazy lot of allocation for AND/OR cases. It splits arguments,
factors out NOT, re-arranges later, etc.
I have not benchmarked that, however AND/OR seem to be expensive with current
RexSimplify.
{quote} Also we had to add "IS TRUE" wrapper nodes on each call{quote}
Is that a real problem? Allocation of a couple of objects might easily be
negligible.
I think it is much more important to be able to follow RexSimplify logic. We
don't need for RexSimplify to cover all the possible optimization cases,
however we do want RexSimplify to be understandable and reliable.
I suggest we fix known issues with current RexSimplify (so unit tests have all
the known simplifications), then we can create new RexSimplify and we can
compare them.
> RexSimplify: fuse unknownAsFalse and IS TRUE handling
> -----------------------------------------------------
>
> Key: CALCITE-2451
> URL: https://issues.apache.org/jira/browse/CALCITE-2451
> Project: Calcite
> Issue Type: Sub-task
> Components: core
> Affects Versions: 1.17.0
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
> Priority: Major
>
> It looks like {{unknownAsFalse}} duplicates {{IS_TRUE}} handling.
> In other words, {{withUnknownAsFalse(true). simplfy(expr)}} is more or less
> comparable to {{simplify(isTrue(expr))}}
> Implementing {{IS_TRUE/IS_FALSE/...}} simplification possibilities might make
> {{unknownAsFalse}} obsolete.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)