mirror of https://github.com/ByConity/ByConity
Merge pull request #15178 from amosbird/dtcf
Fix performance issue when doing datetime comparison
This commit is contained in:
commit
3bc09bb867
|
@ -1213,7 +1213,7 @@ public:
|
|||
const bool left_is_string = isStringOrFixedString(which_left);
|
||||
const bool right_is_string = isStringOrFixedString(which_right);
|
||||
|
||||
bool date_and_datetime = (left_type != right_type) &&
|
||||
bool date_and_datetime = (which_left.idx != which_right.idx) &&
|
||||
which_left.isDateOrDateTime() && which_right.isDateOrDateTime();
|
||||
|
||||
if (left_is_num && right_is_num && !date_and_datetime)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<test>
|
||||
<query>SELECT count() FROM numbers(1000000000) WHERE materialize(now()) > toString(toDateTime('2020-09-30 00:00:00'))</query>
|
||||
<query>SELECT count() FROM numbers(1000000000) WHERE materialize(now()) > toUInt32(toDateTime('2020-09-30 00:00:00'))</query>
|
||||
<query>SELECT count() FROM numbers(1000000000) WHERE materialize(now()) > toDateTime('2020-09-30 00:00:00')</query>
|
||||
</test>
|
Loading…
Reference in New Issue