Details
-
Task
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.2.2-2, 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-3, 10.2.2-4, 10.2.3-1, 10.2.3-2
Description
Would it be possible to make DATE() on datetime column sargable in some cases?
Like rewrite "DATE(col) = const" to "col BETWEEN concat(const, ' 00:00:00') AND concat(const, ' 23:59:59')"
Other similar cases:
- "YEAR(col) = const" is almost the same
- "YEAR(col) = c1 AND MONTH(col) = c2" and other such combinations may be too complex to be worth it.
Attachments
Issue Links
- causes
-
MDEV-30901 Index usage for DATE(datetime_column) = const does not work for engine Memory
- Closed
-
MDEV-30913 Index usage for DATE(datetime_column) = const does not work for engine Connect
- Closed
-
MDEV-30946 Index usage for DATE(datetime_column) = const does not work for DELETE and UPDATE
- Closed
-
MDEV-33299 Assertion `(tm->tv_usec % (int) log_10_int[6 - dec]) == 0' failed in void my_timestamp_to_binary(const timeval*, uchar*, uint)
- Closed
- is duplicated by
-
MDEV-8937 Optimize date functions in the parser
- Closed
- relates to
-
MDEV-30930 Make more date conditions sargable
- Open
-
MDEV-14635 Convert date operations on indexed column to sargable equivalents where possible
- Closed