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

ADD / DROP COLUMN is very slow on 10.3 debug build

    Details

      Description

      ADD / DROP column on 10.3 debug build takes 5-10 seconds on a small enough table (e.g. 2000 rows) having a blob field. On 10.2 debug it only takes about 1 second.

      NOTE: The test case is for reproducing only, don't put it into the regression test suite!

      --source include/have_innodb.inc
       
      --let $num = 2000
       
      CREATE TABLE `t1` (
        `col1` int(11) NOT NULL,
        `col2` int(11) DEFAULT NULL,
        `col3` int(11) DEFAULT NULL,
        `col4` text NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1
      ;
       
      BEGIN;
      --disable_query_log
      --echo # Inserting $num rows...
      while ($num)
      {
        INSERT INTO t1 (col1,col2,col3,col4) VALUES (3,3,3,REPEAT('a',10000));
        --dec $num
      }
      --enable_query_log
      COMMIT;
       
      select now(6);
      ALTER TABLE t1 ADD COLUMN extra INT;
      select now(6);
      ALTER TABLE t1 DROP COLUMN extra;
      select now(6);
       
      DROP TABLE t1;
      

      10.3 578b2b05b8f

      2017-08-26 02:06:06.273911
      ALTER TABLE t1 ADD COLUMN extra INT;
      select now(6);
      now(6)
      2017-08-26 02:06:15.255533
      ALTER TABLE t1 DROP COLUMN extra;
      select now(6);
      now(6)
      2017-08-26 02:06:20.596070
      

      10.2 a544225d0a7

      2017-08-26 02:08:49.037541
      ALTER TABLE t1 ADD COLUMN extra INT;
      select now(6);
      now(6)
      2017-08-26 02:08:50.230408
      ALTER TABLE t1 DROP COLUMN extra;
      select now(6);
      now(6)
      2017-08-26 02:08:51.368844
      

        Attachments

          Activity

            People

            • Assignee:
              monty Michael Widenius
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: