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

HASH_SEARCH() is duplicating effort before HASH_INSERT() or HASH_DELETE()

Details

    Description

      The InnoDB hash table implementation defines the macros HASH_SEARCH, HASH_INSERT, and HASH_DELETE. Often, a HASH_SEARCH operation would already navigate to the correct hash bucket and to the correct position for a subsequent insert or delete operation. This effort will be wasted, because there is no way for HASH_INSERT or HASH_DELETE to refer to that position.

      Similar to what was done to buf_pool.page_hash in MDEV-26826, we had better replace these macros with something more efficient, basically passing some kind of "iterator" from a search operation to the insert or delete operations.

      Attachments

        Issue Links

          Activity

            I am done reviewing the current patch. The changes look functionally correct to me and the improvement points are good.

            One not so good observation is that we are losing our grip on hash table abstraction with hash operations being directly coded when one is using a hash table. I think the key improvement points can be incorporated with a better hash table abstraction.

            debarun Debarun Banerjee added a comment - I am done reviewing the current patch. The changes look functionally correct to me and the improvement points are good. One not so good observation is that we are losing our grip on hash table abstraction with hash operations being directly coded when one is using a hash table. I think the key improvement points can be incorporated with a better hash table abstraction.

            I addressed your concern by introducing find and search member functions. The latter is what can be used by a subsequent insert or delete operation, while the find basically replaces the hash bucket traversal of HASH_SEARCH.

            marko Marko Mäkelä added a comment - I addressed your concern by introducing find and search member functions. The latter is what can be used by a subsequent insert or delete operation, while the find basically replaces the hash bucket traversal of HASH_SEARCH .

            Looks good. Thanks for addressing the comments.

            debarun Debarun Banerjee added a comment - Looks good. Thanks for addressing the comments.

            People

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