Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
None
-
None
-
None
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:
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
StringBuilder sb = new StringBuilder((values.size() + 1) * 16);
It's about 20% performance improvement and mem is more smooth.