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

Updating cache for INFORMATION_SCHEMA.INNODB_LOCKS et al is suboptimal

    XMLWordPrintable

Details

    Description

      The function trx_i_s_common_fill_table() is filling and using a common cache for the following views:

      • INFORMATION_SCHEMA.INNODB_TRX
      • INFORMATION_SCHEMA.INNODB_LOCKS
      • INFORMATION_SCHEMA.INNODB_LOCK_WAITS

      This may invoke the function add_lock_to_cache() several times, once for each qualifying lock. There are a few problems with this:

      • The lock is first being searched for, to avoid duplicates. (Why not do this as part of the insert? Could we use std::unordered_map::emplace() with a custom allocator?)
      • The function fold_lock() may be invoked unnecessarily many times. There is also a similar problem in ha_storage_put_memlim(). It could be better to use my_crc32c(), like we did in MDEV-25905 for another hash table. In that way, the inefficient and collision-prone ut_fold_ulint_pair() and ut_fold_binary() would only be used for backward compatibility in the following:
        • databases that were originally created with innodb_checksum_algorithm=innodb; the default was changed already in MySQL 5.6 and MariaDB Server 10.0
        • the adaptive hash index functions dtuple_fold() and rec_fold(); changing that hash function might have an unpredictable performance impact

      Attachments

        Issue Links

          Activity

            People

              debarun Debarun Banerjee
              marko Marko Mäkelä
              Votes:
              1 Vote for this issue
              Watchers:
              2 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.