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

Remove calls to current_thd while creating Item

Details

    Description

      current_thd() is called many times while creating Items (in many cases 2 or more calls per item).

      The problem is not only the number of calls to current_thd(), but also that when we create items we cause more calls, like calling sql_alloc() that calls current_thd and then uses this to call alloc_root() with the right argumetns.

      By adding thd as an argument to all functions that creates Items, we can avoid most calls to current_thd(). We can also call alloc_root() directly instead of calling it trough sql_alloc().

      Changes in the code as part of this task:

      • Add THD as an argument to all functions that creates an Item.
      • Replace 'new Item_xxx' with 'new (thd->memroot) Item_xxx
      • Add thd->memroot as an argument to push_back() and push_front() for lists.

      Before adding this to 10.1 code base, we need to benchmark the result to see that this big change is really worth it.

      Attachments

        Issue Links

          Activity

            monty Michael Widenius created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Fix Version/s 10.1.0 [ 12200 ]
            Fix Version/s 10.1.x-Beta [ 15801 ]
            serg Sergei Golubchik made changes -
            Workflow defaullt [ 39509 ] MariaDB v2 [ 43659 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.1.0 [ 12200 ]
            monty Michael Widenius made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            serg Sergei Golubchik made changes -
            Summary Remove calls to current_thd while creating Item. Remove calls to current_thd while creating Item
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 43659 ] MariaDB v3 [ 64611 ]
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            Epic Link MDEV-7941 [ 50796 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.1.7-2 [ 12 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked higher
            serg Sergei Golubchik made changes -
            Rank Ranked higher
            monty Michael Widenius made changes -
            Component/s Parser [ 10201 ]
            Fix Version/s 10.1.7 [ 19604 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 64611 ] MariaDB v4 [ 132332 ]

            People

              monty Michael Widenius
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.