[MDEV-17993] WHERE F(X) = constY should used F(X) generated index and query WHERE G=constY Created: 2018-12-13 Updated: 2018-12-19 Resolved: 2018-12-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
I noticed when porting MDEV-15854 that in MySQL: https://github.com/mysql/mysql-server/blob/8.0/mysql-test/r/func_uuid.result#L297-L301 There wasn't any specific UUID code causing this so it could be generic. For any pure function, a generated index on F(X) for a query `WHERE F(X) = Y` could used the generated index `G=F(X)`to search for `Y``. There's an overhead of course searching for a generated column`F(X)` in a query, however this only needs to be done if the comparison point is a constant and the other side is a function. When this occurs no index is usable anyway. |
| Comments |
| Comment by Sergei Golubchik [ 2018-12-19 ] |
|
Looks like a duplicate of MDEV-6017, right? |
| Comment by Daniel Black [ 2018-12-19 ] |
|
quite right, sorry meant to mark as such a few days ago. |