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

Better Support For Partitions/Prune By Date

    XMLWordPrintable

Details

    Description

      I created a table based on a hash of a date:

      CREATE TABLE employees (
          id INT NOT NULL,
          fname VARCHAR(30),
          lname VARCHAR(30),
          hired DATE NOT NULL DEFAULT NOW(),
          separated DATE NOT NULL DEFAULT '9999-12-31',
          job_code INT,
          store_id INT
      )
      PARTITION BY HASH( DAYOFYEAR(hired) )
      PARTITIONS 45;

      I would think that the query engine could prune searches since the hash value is, in my situation, monotonically increasing, but it does not appear to be the case. In a range search, the optimizer should be able to put the lower and upper bounds of the range into the hash function to come up with the upper and lower bounds for pruning partitions.

      Attachments

        Activity

          People

            ycp Yuchen Pei
            belugabehr BELUGABEHR
            Votes:
            1 Vote for this issue
            Watchers:
            6 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.