Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10027

Allow partition pruning when using functions.

    XMLWordPrintable

Details

    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)
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            kjoiner Kyle Joiner (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.