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

Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 10.0.7
    • Component/s: None
    • Labels:
      None

      Description

      tc_acquire_table and tc_release_table are critical sections of table cache. Among other things, they update TABLE_SHARE::tdc.used_tables:
      tc_acquire_table - push new TABLE object to used_tables
      tc_release_table - remove TABLE object from used_tables

      used_tables list is not really necessary for table cache to operate properly. We can change it with all_tables list instead. tc_acquire_table and tc_release_table wont need to access all_tables list at all.

      The cost is as following:

      • 2 additional pointers per TABLE object
      • SHOW OPEN TABLES will have to iterate all_tables and skip objects with in_use == 0
      • same for TABLE_SHARE::visit_subgraph()
      • same for kill_delayed_threads_for_table()

      A patch for this task has been tested (read-only single table OLTP, 4 CPU linux server) and shown ~30% lower LOCK_open wait time and ~20% higher tps.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              svoj Sergey Vojtovich
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: