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

Missing index cardinality on ENABLE KEYS

    XMLWordPrintable

Details

    Description

      Indexes missing cardinality after importing data from the dump. Specifically cardinality is not populated after indexes enabled after being disabled. Simple query to demonstrate the problem:

      DROP TABLE IF EXISTS `bad_table`;
      CREATE TABLE `bad_table` (
          `id1` INT(10) UNSIGNED NOT NULL,
          `id2` INT(10) UNSIGNED NOT NULL,
          INDEX `idx1` (`id1`, `id2`)
      )
      ENGINE=MyISAM;
       
      /*!40000 ALTER TABLE `jobListDevices` DISABLE KEYS */;
      INSERT INTO `bad_table` VALUES
      (1,1),
      (1,2),
      (1,3),
      (1,4),
      (2,1),
      (2,2),
      (2,3),
      (2,4),
      (3,1),
      (3,2),
      (3,3),
      (3,4)
      ;
      /*!40000 ALTER TABLE `jobListDevices` ENABLE KEYS */;
      show index from `bad_table`;
      analyze table `bad_table`;
      show index from `bad_table`;

      Attachments

        1. variables.txt
          14 kB
          Vitaliy Margolen

        Activity

          People

            serg Sergei Golubchik
            Vitaliy Vitaliy Margolen
            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.