[
https://issues.apache.org/jira/browse/CALCITE-6330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17827073#comment-17827073
]
Stamatis Zampetakis commented on CALCITE-6330:
----------------------------------------------
Based on the SqlExplainLevel specification I am not sure if it was ever
intended to bring anything else except the cost. The average row size may be a
nice thing to have but others would possibly find other metadata useful as
well. Every new thing that we add increases the serialization cost so there is
a fine line with how many things we can put in there.
Usually people who need to add more metadata tend to extend or implement their
own RelWriter.
> Print the average row size when when explaining an operator
> -----------------------------------------------------------
>
> Key: CALCITE-6330
> URL: https://issues.apache.org/jira/browse/CALCITE-6330
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: mengdou
> Assignee: mengdou
> Priority: Minor
>
> In this time, when we dump the plan of a RelNode Tree, there is no average
> row size exported in the output string, even if
> SqlExplainLevel.ALL_ATTRIBUTES is specified.
> Because the implementation in explain_() in class RelWriterImpl doesn't
> include the metric average_row_size:
>
> {code:java}
> switch (detailLevel) {
> case ALL_ATTRIBUTES:
> s.append(": rowcount = ")
> .append(mq.getRowCount(rel))
> .append(", cumulative cost = ")
> .append(mq.getCumulativeCost(rel));
> }
> switch (detailLevel) {
> case NON_COST_ATTRIBUTES:
> case ALL_ATTRIBUTES:
> if (!withIdPrefix) {
> // If we didn't print the rel id at the start of the line, print
> // it at the end.
> s.append(", id = ").append(rel.getId());
> }
> break;
> } {code}
>
> So I'd like to add this metric by calling md.getAverageRowSize(rel)
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)