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

update_time column of on i_s.tables remains NULL for sequence objects

Details

    Description

      Following code returns NULL for InnoDB

      create or replace sequence test.x engine = innodb;
      select next value for test.x;
      select update_time from information_schema.tables where (table_name, table_schema) = ('x','test');
      

      The same for aria or myisam returns correct timestamp:

      create or replace sequence test.x1 engine = myisam;
      select next value for test.x1;
      create or replace sequence test.x2 engine = aria;
      select next value for test.x2;
      select update_time from information_schema.tables where (table_name, table_schema) in ( ('x2','test'),('x1','test'));
      

      Attachments

        Issue Links

          Activity

            For a note, update_time for InnoDB tables in I_S is pretty useless anyway, as it doesn't survive server restart. If it can be fixed as well, it would be great of course.
            That's an old limitation (which just recently replaced an even older limitation when update_time wasn't populated for InnoDB tables at all).

            elenst Elena Stepanova added a comment - For a note, update_time for InnoDB tables in I_S is pretty useless anyway, as it doesn't survive server restart. If it can be fixed as well, it would be great of course. That's an old limitation (which just recently replaced an even older limitation when update_time wasn't populated for InnoDB tables at all).

            I wouldn’t fix this before we get a persistent update_time. That field would have to be stored somewhere in the data file (clustered index root page?). It is doable for sequences (which consist of a single page anyway), but could create a performance bottleneck for general tables if we really update it in real-time. On the other hand, that is what we are doing to the persistent AUTO_INCREMENT, and nobody complained yet that the root page is becoming a bottleneck.

            marko Marko Mäkelä added a comment - I wouldn’t fix this before we get a persistent update_time. That field would have to be stored somewhere in the data file (clustered index root page?). It is doable for sequences (which consist of a single page anyway), but could create a performance bottleneck for general tables if we really update it in real-time. On the other hand, that is what we are doing to the persistent AUTO_INCREMENT, and nobody complained yet that the root page is becoming a bottleneck.

            A simple change that we could do is to report the .ibd file timestamp as the update_time, and NULL if the sequence is stored in a shared tablespace file.

            marko Marko Mäkelä added a comment - A simple change that we could do is to report the .ibd file timestamp as the update_time, and NULL if the sequence is stored in a shared tablespace file.

            Starting with MariaDB 10.2.2, InnoDB maintains a non-persistent update_time for persistent transactional tables (it will be forgotten across server restart). Sequence objects are not transactional; they are only persisted. Thus, sequence objects would requires some other kind of update_time mechanism.

            Maybe at the same time with implementing update_time for InnoDB sequences, we should implement persistent update_time for InnoDB tables.

            marko Marko Mäkelä added a comment - Starting with MariaDB 10.2.2, InnoDB maintains a non-persistent update_time for persistent transactional tables (it will be forgotten across server restart). Sequence objects are not transactional; they are only persisted. Thus, sequence objects would requires some other kind of update_time mechanism. Maybe at the same time with implementing update_time for InnoDB sequences, we should implement persistent update_time for InnoDB tables.

            People

              marko Marko Mäkelä
              anikitin Andrii Nikitin (Inactive)
              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.