You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "hqx (Jira)" <ji...@apache.org> on 2021/03/05 02:00:00 UTC
[jira] [Comment Edited] (CALCITE-4522) optimize sort cost formula
[ https://issues.apache.org/jira/browse/CALCITE-4522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295696#comment-17295696 ]
hqx edited comment on CALCITE-4522 at 3/5/21, 1:59 AM:
-------------------------------------------------------
[~julianhyde] hi
there is no need to sort, I mean the Relcollation#fieldCollations is empty.
I have make a pr, you may help me review it at [https://github.com/apache/calcite/pull/2363
|https://github.com/apache/calcite/pull/2363|
was (Author: 871):
[~julianhyde] hi
there is no need to sort, I mean the Relcollation#fieldCollations is empty.
I have make a pr, you may help me review it at [https://github.com/apache/calcite/pull/2363
|https://github.com/apache/calcite/pull/2363,]
> optimize sort cost formula
> --------------------------
>
> Key: CALCITE-4522
> URL: https://issues.apache.org/jira/browse/CALCITE-4522
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: hqx
> Priority: Minor
>
> The old method to compute the cost of sort has some problem.
> # when there is no need to sort, it still to compute the cpu cost of sort.
> # use n * log\(n) * rowBytes to estimate the cpu cost may be inaccurate, where n means the output row count of the sort operator, and rowBytes means the average bytes of one row .
> Instead, I give follow suggestion.
> # the cpu cost is zero if there is no need to sort.
> # use m * log\(n)* rowBytes to compute the cpu cost, where m is the sum of offset + limit and n means input row count.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)