From 48b3c21aaaf8ee9aa0facf5b7a801843c0986594 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Tue, 15 Oct 2019 15:18:15 +0300 Subject: [PATCH] More performance test for Date and DateTime Added cases for: * binary operations: -,+,>,>=,<,<=,==,!= * previously-missing functions: timeSlot, toRelativeQuarterNum, toStartOfTenMinutes, toUnixTimestamp, addYears (and alike). --- dbms/tests/performance/date_time.xml | 57 ++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/dbms/tests/performance/date_time.xml b/dbms/tests/performance/date_time.xml index b62cde40860..77a6c634b34 100644 --- a/dbms/tests/performance/date_time.xml +++ b/dbms/tests/performance/date_time.xml @@ -54,6 +54,11 @@ toYYYYMM toYYYYMMDD toYYYYMMDDhhmmss + + timeSlot + toRelativeQuarterNum + toStartOfTenMinutes + toUnixTimestamp @@ -70,6 +75,7 @@ toDate toMonday + toStartOfDay toStartOfMonth toStartOfQuarter toStartOfYear @@ -83,18 +89,55 @@ toYYYYMM toYYYYMMDD toYYYYMMDDhhmmss + + toRelativeQuarterNum + toUnixTimestamp - - - time_zone - + + + time_zone + UTC Europe/Moscow Asia/Kolkata - - + + + + binary_function + + lessOrEquals + less + greater + greaterOrEquals + equals + notEquals + plus + minus + addDays + addHours + addMinutes + addMonths + addQuarters + addSeconds + addWeeks + addYears + subtractDays + subtractHours + subtractMinutes + subtractMonths + subtractQuarters + subtractSeconds + subtractWeeks + subtractYears + + SELECT count() FROM system.numbers WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, {datetime_transform}(t, '{time_zone}')) + SELECT count() FROM system.numbers WHERE NOT ignore(toDate('2017-01-01') + number % 1000 + rand() % 10 AS t, {date_transform}(t)) - + + SELECT count() FROM system.numbers WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, {binary_function}(t, 1)) + + SELECT count() FROM system.numbers WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, toStartOfInterval(t, INTERVAL 1 month)) + \ No newline at end of file