You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "yx91490 (Jira)" <ji...@apache.org> on 2022/09/22 11:27:00 UTC

[jira] [Commented] (IMPALA-11504) Speed up Decimal16Value division by specializing DecimalUtil::GetScaleMultiplier()

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

yx91490 commented on IMPALA-11504:
----------------------------------

I make a test to test performance improvement:

dataset:

 
{code:java}
CREATE TABLE t (
    d1 DECIMAL(19, 3),
    d2 DECIMAL(19, 3)
) STORED AS PARQUET;

-- generate random data
INSERT OVERWRITE t
SELECT 
       cast(rand() * 1000 as DECIMAL(19, 3)) AS d1,
       -- prevent divide 0
       cast((rand(unix_timestamp()) +1) * 1000000 as DECIMAL(19, 3)) AS d2
FROM tpcds.customer t1,
     tpcds.customer t2 LIMIT 50000000;{code}
test SQL:
{code:java}
SELECT count(d1/d2) FROM t; {code}
result:

 
||version||cost time||
|origin edition|16s|
|optimized edition|7s|

 

 

 

> Speed up Decimal16Value division by specializing DecimalUtil::GetScaleMultiplier<int256_t>()
> --------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-11504
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11504
>             Project: IMPALA
>          Issue Type: Improvement
>            Reporter: yx91490
>            Assignee: yx91490
>            Priority: Major
>
> There exists a call chain:
> {code:java}
> DecimalValue<int128_t>::Divide() -> 
> DecimalUtil::MultiplyByScale<int256_t>() ->
> DecimalUtil::GetScaleMultiplier(){code}
> but decimal-util.h didn't specialize DecimalUtil::GetScaleMultiplier<int256_t>(), causing more performance loss.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org