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

LP:941889 - JOIN constructors takes a long time in 5.3

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      I run sysbench on MariaDB on Windows with Visual Studio sampling profiler , comparing 5.2 and 5.3 performance.
      sysbench version is 0.5 and for the test I created select1.lua, which does nothing else but running prepared "SELECT 1".

      Performance reports show a big difference inside JOIN constructor, and for this specific test JOIN::JOIN is the most expensive function with 24.23% exclusive samples.

      Here is he list of functions that show up as more expensive in 5.3 compared to 5.2

      Comparison Column Delta Baseline Value Comparison Value
      JOIN::JOIN 23,15 1,08 24,23
      RtlpAllocateHeap 3,24 0,00 3,24
      RtlpInsertFreeBlock 1,93 0,00 1,93
      RtlpFreeHeap 1,42 0,00 1,42

      Looking at what has changed from 5.2 to 5.3, JOIN structure grew from around 5K to around 32K. Besides, it contains 2 large arrays of POSITION structures, and POSITION has a non-trivial constructor, since it includes semi-join strategy classes for which virtual function tables must be setup (confirmed by switching to disassembly and single-stepping through JOIN::JOIN)

      Attachments

        1. LPexportBug941889_941889.diff
          4 kB
          Rasmus Johansson
        2. LPexportBug941889_join_constructor_patch.diff
          3 kB
          Rasmus Johansson
        3. LPexportBug941889_select1_1.lua
          0.2 kB
          Rasmus Johansson
        4. LPexportBug941889_select1_test.sh
          0.2 kB
          Rasmus Johansson
        5. LPexportBug941889.xml
          35 kB
          Rasmus Johansson

        Activity

          People

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