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

information_schema tables need optimization

    XMLWordPrintable

Details

    Description

      this statement fails in database information_schema
      ALTER TABLE TABLES ADD UNIQUE INDEX UK_TABLES(TABLE_SCHEMA, TABLE_NAME);
      Right now the statement below, which I use hundreds of times per second, is performing a full table scan
      SELECT AUTO_INCREMENT - 1 FROM INFORMATION_SCHEMA.TABLES where table_schema ='x' and table_name='y')
      I could add an index but it does not allow me any such privileges. It should allow me to improve the internal tables.
      I use this statement because I need to know inside a stored procedure which is the highest ID in the table. To do full count or a max(ID) is slower than the statement above. Am I wrong?

      Attachments

        Activity

          People

            serg Sergei Golubchik
            philip_38 Philip orleans
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.