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

AUTO_INCREMENT and partitioning

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.1.10
    • N/A
    • Partitioning
    • None
    • Windows

    Description

      Hi,

      1- I have a table with a unique key which is calculated by the AUTO_INCREMENT feature, and I need to range partition it using a date field , is it possible and/or how to do it?

      2- Is there a way to implement sequences for the primary key (like it exists in Oracle) or the AUTO_INCREMENT is the only one in MariaDb?

      For example:

       CREATE TABLE new (
               id INT NOT NULL AUTO_INCREMENT,
               name VARCHAR(50),
              added DATE,
               PRIMARY KEY (id),
           )     
          PARTITION BY RANGE( TO_DAYS(added) ) 
        ( PARTITION p0 VALUES LESS THAN (1990),
         PARTITION p1 VALUES LESS THAN (2000),
         PARTITION p2 VALUES LESS THAN MAXVALUE  
      	 ) ;     
      

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            Mariabti Btissam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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