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

PageStats::scan_below() needlessly latches on non-leaf pages and holds the latches until the dive ends

    XMLWordPrintable

Details

    Description

      PageStats::scan_below() starts a mini-transaction and takes an
      RW_S_LATCH on every page it visits while descending from the mid
      level to a leaf, releasing nothing until mtr.commit() at the end.
      Both the latches and the buffer-fixes therefore accumulate for the whole dive.

      The latches on the non-leaf pages are redundant: the caller already
      holds dict_index_t::lock in U mode (mtr_sx_lock_index()), and any
      thread modifying a non-leaf page must hold that lock in a
      conflicting mode. The page latch only adds cost while ANALYZE
      TABLE (or a background statistics recalculation) dives through the
      tree, it blocks buf_flush_page_cleaner() from writing out those
      dirty non-leaf pages, for no benefit.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              0 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.