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

Instant alter drop index not supported in 10.4.24

Details

    Description

      Documentation at https://mariadb.com/kb/en/innodb-online-ddl-operations-with-the-instant-alter-algorithm/#alter-table-drop-index-and-drop-index states that 10.4 supports DROP INDEX ..., ALGORITHM=INSTANT, but it does not.

      This is what I get when I run the example from that URL:

      MariaDB [(none)]> \s
      --------------
      ./bin/mysql  Ver 15.1 Distrib 10.4.24-MariaDB, for Linux (x86_64) using readline 5.1
       
      Connection id:		8
      Current database:	
      Current user:		bdempsey@localhost
      SSL:			Cipher in use is DHE-RSA-AES256-GCM-SHA384
      Current pager:		stdout
      Using outfile:		''
      Using delimiter:	;
      Server:			MariaDB
      Server version:		10.4.24-MariaDB-debug Source distribution
      Protocol version:	10
      Connection:		Localhost via UNIX socket
      Server characterset:	latin1
      Db     characterset:	latin1
      Client characterset:	utf8
      Conn.  characterset:	utf8
      UNIX socket:		/home/bdempsey/mariadb/10.2/data/mysql.sock
      Uptime:			1 min 8 sec
       
      Threads: 6  Questions: 4  Slow queries: 0  Opens: 17  Flush tables: 1  Open tables: 10  Queries per second avg: 0.058
      --------------
       
      MariaDB [foo]> CREATE OR REPLACE TABLE tab (
          ->    a int PRIMARY KEY,
          ->    b varchar(50),
          ->    c varchar(50),
          ->    INDEX b_index (b)
          -> );
      Query OK, 0 rows affected (0.053 sec)
       
      MariaDB [foo]> SET SESSION alter_algorithm='INSTANT';
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [foo]> ALTER TABLE tab DROP INDEX b_index;
      ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
      

      Attachments

        Issue Links

          Activity

            Because DROP INDEX will take time proportional to the size of the index (to traverse not the index tree, but the linked list of allocated page numbers), it does not belong to the ALGORITHM=INSTANT subset of ALGORITHM=INPLACE. It is allowed by ALGORITHM=NOCOPY.

            The unfortunately named ALGORITHM=INPLACE allows the table to be rebuilt (copied), while ALGORITHM=NOCOPY does not allow that. A name like ALGORITHM=ENGINE would have been more appropriate for the generic native ALTER TABLE.

            marko Marko Mäkelä added a comment - Because DROP INDEX will take time proportional to the size of the index (to traverse not the index tree, but the linked list of allocated page numbers), it does not belong to the ALGORITHM=INSTANT subset of ALGORITHM=INPLACE . It is allowed by ALGORITHM=NOCOPY . The unfortunately named ALGORITHM=INPLACE allows the table to be rebuilt (copied), while ALGORITHM=NOCOPY does not allow that. A name like ALGORITHM=ENGINE would have been more appropriate for the generic native ALTER TABLE .
            greenman Ian Gilfillan added a comment -

            The section has been removed.

            greenman Ian Gilfillan added a comment - The section has been removed.

            People

              greenman Ian Gilfillan
              bdempsey64 Bob Dempsey
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.