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

Spiral patch 018_mariadb-10.0.15.hash_tuning.diff

Details

    Attachments

      Activity

        MariaDB already offers solutions for similar problems: LF_HASH and hash_function() method.

        svoj Sergey Vojtovich added a comment - MariaDB already offers solutions for similar problems: LF_HASH and hash_function() method.

        Yes, we have LF_HASH, but the old hash is still used a lot and not having to calculate the hash over and over again will speed up things.

        monty Michael Widenius added a comment - Yes, we have LF_HASH, but the old hash is still used a lot and not having to calculate the hash over and over again will speed up things.

        Subject: Re: MDEV-7716 - Spiral patch 018_mariadb-10.0.15.hash_tuning.diff
         
        Hi Sergey,
         
        > What was the main problem that this patch is solving? Was it scalability
        > improvement by moving hash calculation out of mutex? Or was it generic
        > performance improvement so that hash value is never calculated twice?
         
        It's for both.
         
        > I'm asking because we should have solutions for both cases. There is
        > HASH::hash_function(), which may be used to return cached hash value
        > (e.g. see MDL). There is also lock-free hash that offers even better
        > scalability (btw it also supports hash_function()). Why didn't these
        > options work for you?
         
        Does it mean "it's already support by MariaDB, and use lock-free hash
        for scalability" right? If it is right, I'll try to change Spider code
        for using lock-free hash, and this patch doesn't need to merge.
         
        Thanks,
        Kentoku
        

        svoj Sergey Vojtovich added a comment - Subject: Re: MDEV-7716 - Spiral patch 018_mariadb-10.0.15.hash_tuning.diff   Hi Sergey,   > What was the main problem that this patch is solving? Was it scalability > improvement by moving hash calculation out of mutex? Or was it generic > performance improvement so that hash value is never calculated twice?   It's for both.   > I'm asking because we should have solutions for both cases. There is > HASH::hash_function(), which may be used to return cached hash value > (e.g. see MDL). There is also lock-free hash that offers even better > scalability (btw it also supports hash_function()). Why didn't these > options work for you?   Does it mean "it's already support by MariaDB, and use lock-free hash for scalability" right? If it is right, I'll try to change Spider code for using lock-free hash, and this patch doesn't need to merge.   Thanks, Kentoku

        monty, I leave it up to you to decide. I believe hash_function() can be used to solve hash value recalculation.

        svoj Sergey Vojtovich added a comment - monty , I leave it up to you to decide. I believe hash_function() can be used to solve hash value recalculation.
        monty Michael Widenius added a comment - - edited

        New implementation with full test case done (the test case also found issues in the original code be Kentoku, so it was good to have it done):

        • Improved mysys/hash.cc by caching hash_nr. This is done without using any additional memory
        • Removed usage of my_hash_search() with uninitialized HASH.
          • Not documented or intended usage
          • Extra checking takes time for all HASH usage
        monty Michael Widenius added a comment - - edited New implementation with full test case done (the test case also found issues in the original code be Kentoku, so it was good to have it done): Improved mysys/hash.cc by caching hash_nr. This is done without using any additional memory Removed usage of my_hash_search() with uninitialized HASH. Not documented or intended usage Extra checking takes time for all HASH usage

        Pushed into 10.2. Will merge to 10.2-spider shortly

        monty Michael Widenius added a comment - Pushed into 10.2. Will merge to 10.2-spider shortly

        People

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