Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-3141][CH] Rewrite date comparison expression into a more efficient way #3592

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

lgbo-ustc
Copy link
Contributor

@lgbo-ustc lgbo-ustc commented Nov 2, 2023

What changes were proposed in this pull request?

(Please fill in changes proposed in this fix)

Fixes: #3141

Test result is given as following.

data set

CREATE TABLE default.test_time_cmp (ts INT, val INT) USING parquet;
insert into test_time_cmp select 1693497600 + (rand() * 1000000000) % 2592000 as ts, id as val from range(0, 10000000);

performance comparison

condition before after
from_unixtime(ts, 'yyyy-MM-dd') > '2023-09-15' 0.862 seconds 0.367 seconds
from_unixtime(ts, 'yyyy-MM-dd') >= '2023-09-15' 0.879 seconds 0.347 seconds
from_unixtime(ts, 'yyyy-MM-dd') < '2023-09-15' 0.887 seconds 0.334 seconds
from_unixtime(ts, 'yyyy-MM-dd') < '2023-09-15' 0.919 seconds 0.319 seconds
from_unixtime(ts, 'yyyy-MM-dd') = '2023-09-15' 0.872 seconds 0.371 seconds
to_date(from_unixtime(ts)) > '2023-09-15' 4.507 seconds 0.331 seconds

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
unit tests

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

Copy link

github-actions bot commented Nov 2, 2023

#3141

Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

@lgbo-ustc lgbo-ustc changed the title [GLUTEN-3141][CH] Rewrite date comparision expression into a more efficient way [GLUTEN-3141][CH] Rewrite date comparison expression into a more efficient way Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

zzcclp
zzcclp previously approved these changes Nov 3, 2023
Copy link
Contributor

@zzcclp zzcclp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

1 similar comment
@zzcclp
Copy link
Contributor

zzcclp commented Nov 6, 2023

Run Gluten Clickhouse CI

Copy link
Contributor

@zzcclp zzcclp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zzcclp zzcclp merged commit 5d4cac1 into apache:main Nov 7, 2023
17 checks passed
@GlutenPerfBot
Copy link
Contributor

===== Performance report for TPCH SF2000 with Velox backend, for reference only ====

query log/native_3592_time.csv log/native_master_11_06_2023_d57fdf26f_time.csv difference percentage
q1 31.35 33.34 1.995 106.37%
q2 25.40 24.84 -0.559 97.80%
q3 38.60 38.31 -0.298 99.23%
q4 37.11 37.40 0.295 100.80%
q5 71.10 70.83 -0.271 99.62%
q6 8.10 7.74 -0.357 95.59%
q7 84.70 85.97 1.279 101.51%
q8 85.19 84.68 -0.505 99.41%
q9 121.05 124.39 3.342 102.76%
q10 52.25 54.67 2.415 104.62%
q11 20.32 19.96 -0.358 98.24%
q12 26.44 24.52 -1.926 92.72%
q13 49.06 50.37 1.307 102.66%
q14 16.58 18.50 1.923 111.60%
q15 30.50 32.09 1.598 105.24%
q16 16.68 16.51 -0.168 98.99%
q17 103.42 100.90 -2.521 97.56%
q18 148.90 148.27 -0.627 99.58%
q19 14.86 14.74 -0.118 99.21%
q20 29.99 30.95 0.961 103.21%
q21 225.27 225.06 -0.205 99.91%
q22 13.12 13.61 0.482 103.67%
total 1249.97 1257.65 7.685 100.61%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CH] Do optimization for date comparison
3 participants