Details
-
New Feature
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
Conditions looking like
SUBSTR(str_col, 1, n) = const_str
|
where the prefix of str_col is compared against a constant value can be rewritten as range conditions as
const_str_low <= str_col <= const_str_high
|
which will improve the optimizer capabilities of building better execution plan (for example, using indexes on column str_col and applying range optimizations).
The similar transformation is already implemented for conditions like
str_col LIKE 'foo%' |
aiming for the same goal.
Similar rewrite is implemented for DATE() and YEAR() function at MDEV-8320, and that approach may be used as a reference.
Attachments
Issue Links
- includes
-
MDEV-4414 INDEX - SUBSTRING, LEFT and others string functions that could be optimized with index
-
- Closed
-
- relates to
-
MDEV-35564 cannot convert backslash to swe7
-
- Closed
-
Thanks for the testing - pushed e021770667851233c8cda34e9360606adfd3ea0c to main.
btw julien.fritsch, there are two unreleased 11.8.* versions in the dropdown menu of fix version/s, is that right? I picked the first one 11.8.0