[ 
https://issues.apache.org/jira/browse/CALCITE-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625028#comment-16625028
 ] 

Vladimir Sitnikov commented on CALCITE-2471:
--------------------------------------------

{quote} Could the AbstractRelNode.desc field be eliminated? getDescription and 
toString can compute "rel#" + id + ": " + digest (or whatever) every time they 
are called. If those methods are called less than once on average during the 
lifetime of each RelNode (and that is my hunch), then we'd save both time and 
memory.{quote}

{{VolcanoRuleMatch#computeDigest}} uses {{rel#toString}} which returns {{desc}} 
field, and there might be multiple 

It might be a good idea to replace {{String}} digests with proper keys to avoid 
building large strings and computing hashcodes over them again and again. What 
do you think?

> RelNode description includes all tree when recomputed
> -----------------------------------------------------
>
>                 Key: CALCITE-2471
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2471
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Laurent Goujon
>            Assignee: Julian Hyde
>            Priority: Major
>
> The initial AbstractRelNode description is `{{typeName#id}}` but when 
> recomputed, it includes all its inputs (and other attributes).
> When creating the final plan, HepPlanner visits each node bottom up, and 
> recomputes the node digest. This causes node description to grow in size, up 
> to the top node which contains basically a string copy of the whole tree. On 
> large trees, this may consume a non-significant amount of memory.
> See email thread: 
> https://lists.apache.org/thread.html/5e71c9f2b4e83865805841708f53471cfab1b5de673e6f162b68edc9@%3Cdev.calcite.apache.org%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to