[MDEV-10027] Allow partition pruning when using functions. Created: 2016-05-04  Updated: 2023-04-12

Status: Open
Project: MariaDB Server
Component/s: Optimizer, Partitioning
Fix Version/s: None

Type: Task Priority: Major
Reporter: Kyle Joiner (Inactive) Assignee: Alexey Botchkov
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Enhancement request to allow for partition pruning when using functions:

> mysql [localhost] {msandbox} (test) > explain partitions select * FROM t2 WHERE time_segment = '2016-04-29 09:30:00';
> +------+-------------+-------+------------+------+---------------+---------+---------+-------+------+-------------+
> | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra |
> +------+-------------+-------+------------+------+---------------+---------+---------+-------+------+-------------+
> | 1 | SIMPLE | t2 | p4 | ref | PRIMARY | PRIMARY | 5 | const | 1 | Using index |
> +------+-------------+-------+------------+------+---------------+---------+---------+-------+------+-------------+
> 1 row in set (0.00 sec)
 
> mysql [localhost] {msandbox} (test) > explain partitions select * FROM t2 WHERE date(time_segment) = '2016-04-29'; <<<< ***************** You see another pruning problem when using a function (date). *******
> +------+-------------+-------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
> | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra |
> +------+-------------+-------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
> | 1 | SIMPLE | t2 | p0,p1,p2,p3,p4 | index | NULL | PRIMARY | 9 | NULL | 6 | Using where; Using index |
> +------+-------------+-------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
> 1 row in set (0.00 sec)


Generated at Thu Feb 08 07:39:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.