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

Performance degradation with CURRENT_DATE, LOCALTIME and LOCALTIMESTAMP #7090

Closed
asfernandes opened this issue Jan 3, 2022 · 0 comments
Closed

Comments

@asfernandes
Copy link
Member

asfernandes commented Jan 3, 2022

After introduction of time zones, request's cached timestamp started to be stored in the GMT time zone.

That made ~10x performance degradation to CURRENT_DATE, LOCALTIME and LOCALTIMESTAMP.

Test cases:

execute block
as
    declare n integer = 1;
    declare d date;
begin
    while (n < 1000000)
    do
    begin
        n = n + 1;
        d = current_date;
    end
end!


execute block
as
    declare n integer = 1;
    declare d time;
begin
    while (n < 1000000)
    do
    begin
        n = n + 1;
        d = localtime;
    end
end!


execute block
as
    declare n integer = 1;
    declare d timestamp;
begin
    while (n < 1000000)
    do
    begin
        n = n + 1;
        d = localtimestamp;
    end
end!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment