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

yx91490 edited comment on IMPALA-11504 at 9/25/22 7:14 AM:
-----------------------------------------------------------

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||
|original edition|16s|
|optimized edition|7s|

 

 

 


was (Author: yx91490):
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to