mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-32148 Inefficient WHERE timestamp_column=datetime_const_expr
Changing the way how a the following conditions are evaluated: WHERE timestamp_column=datetime_const_expr (for all comparison operators: =, <=>, <, >, <=, >=, <> and for NULLIF) Before the change it was always performed as DATETIME. That was not efficient, as involved per-row TIMESTAMP->DATETIME conversion for timestamp_column. For example, in case of the SYSTEM time zone it involved a localtime_r() call, which is known to be slow. After the change it's performed as TIMESTAMP in many cases. This allows to avoid per-row conversion, as it works the other way around: datetime_const_expr is converted to TIMESTAMP once before the execution stage. Note, datetime_const_expr must be inside monotone continuous periods of the current time zone, i.e. not near these anomalies: - DST changes (spring forward, fall back) - leap seconds
This commit is contained in:
@ -4283,6 +4283,8 @@ public:
|
||||
utime_after_query= current_utime();
|
||||
}
|
||||
|
||||
Timeval_null safe_timeval_replacement_for_nonzero_datetime(const Datetime &);
|
||||
|
||||
/**
|
||||
Update server status after execution of a top level statement.
|
||||
Currently only checks if a query was slow, and assigns
|
||||
|
Reference in New Issue
Block a user