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

Unnecessary buf_pool.page_hash lookups

Details

    Description

      In the function btr_blob_free() there is an unnecessary lookup of buf_pool.page_hash. If we acquired an additional buffer-fix on the page before mtr_t::commit() and released it after acquiring buf_pool.mutex, we would know that the page still exists in the buffer pool and can be attempted to be freed, without having to look it up in buf_pool.page_hash again.

      There could be similar suboptimal patterns elsewhere as well.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -

            Apart from btr_blob_free(), I found some avoidable look-ups for an index root page and duplicated error handling in dict_load_table_one(). Furthermore, trx_t::apply_log() could do without a mini-transaction, just invoking the recently added buf_pool.page_fix() to access the undo log pages that are in the exclusive ownership of the active transaction.

            marko Marko Mäkelä added a comment - Apart from btr_blob_free() , I found some avoidable look-ups for an index root page and duplicated error handling in dict_load_table_one() . Furthermore, trx_t::apply_log() could do without a mini-transaction, just invoking the recently added buf_pool.page_fix() to access the undo log pages that are in the exclusive ownership of the active transaction.
            marko Marko Mäkelä made changes -
            Summary Unnecessary buf_pool.page_hash lookup in btr_blob_free() Unnecessary buf_pool.page_hash lookups
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2024-10-17 07:28:00.0 2024-10-17 07:28:00.211
            marko Marko Mäkelä made changes -
            Fix Version/s 10.6.20 [ 29903 ]
            Fix Version/s 10.11.10 [ 29904 ]
            Fix Version/s 11.2.6 [ 29906 ]
            Fix Version/s 11.4.4 [ 29907 ]
            Fix Version/s 11.6.2 [ 29908 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]

            People

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