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

Implement DISABLE KEYS/ENABLE KEYS in Innodb

Details

    Description

      DISABLE KEYS : ignoring secondary indexes, until they are reenabled with ENABLE KEYS.

      Also ignoring foreign key constraints, I'd guess (although, there is another setting for that)

      This is a tool that MyISAM/Aria use for the data load, into the empty table.
      The idea is to insert a lot of data (one can assume primary key order for this specific case),
      then build all indexes indexes on ENABLE.

      This should make restoring of mariadb-dump, and mariadb-import automatically faster.

      There is alternative for the data loading tools, to parse the table DDL as given by SHOW CREATE TABLE (MDEV-34740), but ENABLE/DISABLE appears to be much more convenient

      Attachments

        Issue Links

          Activity

            Implementing ALTER TABLE…DISABLE KEYS would require a change to the InnoDB data dictionary format, or maybe better to the data file format (MDEV-11658), to incidate that some indexes need to be rebuilt before they can be used.

            Implementing ALTER TABLE…ENABLE KEYS would be somewhat tricky. I assume that it currently is a blocking operation, because neither MyISAM nor Aria support ALTER TABLE…ALGORITHM=INPLACE, LOCK=NONE. It might be best if the in-datafile index metadata records that I have envisioned in MDEV-11658 would be covered by undo log records. In that way, killing or backing up a server during such an operation should be manageable.

            marko Marko Mäkelä added a comment - Implementing ALTER TABLE…DISABLE KEYS would require a change to the InnoDB data dictionary format, or maybe better to the data file format ( MDEV-11658 ), to incidate that some indexes need to be rebuilt before they can be used. Implementing ALTER TABLE…ENABLE KEYS would be somewhat tricky. I assume that it currently is a blocking operation, because neither MyISAM nor Aria support ALTER TABLE…ALGORITHM=INPLACE, LOCK=NONE . It might be best if the in-datafile index metadata records that I have envisioned in MDEV-11658 would be covered by undo log records. In that way, killing or backing up a server during such an operation should be manageable.

            People

              Unassigned Unassigned
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.