[
https://issues.apache.org/jira/browse/CALCITE-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jiatao Tao updated CALCITE-4577:
--------------------------------
Description:
Example like that: insert xxx VALUES (1, 'one'), (2, 'two'), (3,
'three')...(10000, 'ten thousand');
It generates a Union node with 10000 inputs, and the performance is poor,
here's the profile:
!image-2021-04-11-16-53-35-466.png|width=740,height=185!
!image-2021-04-11-16-53-58-757.png|width=735,height=109!
A point that affects performance is the array copy of StringBuilder, current we
just new StringBuilder with default capacity, my proposal is to consider the
node's input size, like that(we can discuss the strategy):
org.apache.calcite.rel.AbstractRelNode.RelDigestWriter#done
{code:java}
StringBuilder sb = new StringBuilder((values.size() + 1) * 16);{code}
was:
Example like that: insert xxx VALUES (1, 'one'), (2, 'two'), (3,
'three')...(10000, 'ten thousand');
It generate a Union node with 10000 inputs, and the performance is poor, here's
the profile:
> RelDigestWriter#done has performance when node's inputs is large
> ----------------------------------------------------------------
>
> Key: CALCITE-4577
> URL: https://issues.apache.org/jira/browse/CALCITE-4577
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Jiatao Tao
> Assignee: Jiatao Tao
> Priority: Critical
> Attachments: image-2021-04-11-16-53-35-466.png,
> image-2021-04-11-16-53-58-757.png
>
>
> Example like that: insert xxx VALUES (1, 'one'), (2, 'two'), (3,
> 'three')...(10000, 'ten thousand');
> It generates a Union node with 10000 inputs, and the performance is poor,
> here's the profile:
> !image-2021-04-11-16-53-35-466.png|width=740,height=185!
> !image-2021-04-11-16-53-58-757.png|width=735,height=109!
> A point that affects performance is the array copy of StringBuilder, current
> we just new StringBuilder with default capacity, my proposal is to consider
> the node's input size, like that(we can discuss the strategy):
> org.apache.calcite.rel.AbstractRelNode.RelDigestWriter#done
> {code:java}
> StringBuilder sb = new StringBuilder((values.size() + 1) * 16);{code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)