Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1/ Access /admin/index.php on a Moodle instance running on MySQL
      2/ manually convert some table to MyISAM engine
      3/ Access /admin/index.php again and verify warning is displayed

      optionally: Check the slow query log for the "SHOW TABLE STATUS" query

      Show
      1/ Access /admin/index.php on a Moodle instance running on MySQL 2/ manually convert some table to MyISAM engine 3/ Access /admin/index.php again and verify warning is displayed optionally: Check the slow query log for the "SHOW TABLE STATUS" query
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w28_MDL-34010_m24_mysqldiag

      Description

      After upgrading to Moodle 2, we're seeing a slow query in our MySQL slow query log every time we access /admin/index.php:

      SHOW TABLE STATUS WHERE Name LIKE BINARY 'mdl_%';

        Gliffy Diagrams

          Activity

          Hide
          Michael Aherne added a comment -

          Attached is a pull request which updates the code to use information_schema.tables instead of "SHOW STATUS". On our server this executes almost instantly as opposed to over 6 seconds which the original query took.

          Show
          Michael Aherne added a comment - Attached is a pull request which updates the code to use information_schema.tables instead of "SHOW STATUS". On our server this executes almost instantly as opposed to over 6 seconds which the original query took.
          Hide
          Dan Poltawski added a comment -

          Thanks for the patch Michael!

          Show
          Dan Poltawski added a comment - Thanks for the patch Michael!
          Hide
          Dan Poltawski added a comment -

          Petr,

          What do you think of this patch?

          Show
          Dan Poltawski added a comment - Petr, What do you think of this patch?
          Hide
          Petr Skoda added a comment -

          +1, we did something similar in other places alrady

          Show
          Petr Skoda added a comment - +1, we did something similar in other places alrady
          Hide
          Petr Skoda added a comment -

          Hmm, maybe it would be even faster if we verified the Engine='MyISAM' directly in sql and just counted number of tables there.

          Show
          Petr Skoda added a comment - Hmm, maybe it would be even faster if we verified the Engine='MyISAM' directly in sql and just counted number of tables there.
          Hide
          Petr Skoda added a comment -

          I have added one more commit that adds count() on top of your patch, thanks for the report and patch

          to integrators: feel free to cherry pick to 2.3

          Show
          Petr Skoda added a comment - I have added one more commit that adds count() on top of your patch, thanks for the report and patch to integrators: feel free to cherry pick to 2.3
          Hide
          Dan Poltawski added a comment -

          Taking integration held issues out of integration (whilst we are keeping master and 23_STABLE in sync).

          Show
          Dan Poltawski added a comment - Taking integration held issues out of integration (whilst we are keeping master and 23_STABLE in sync).
          Hide
          Dan Poltawski added a comment -

          Integrated to master, thanks guys

          Show
          Dan Poltawski added a comment - Integrated to master, thanks guys
          Hide
          Ankit Agarwal added a comment -

          This works as expected!
          Thanks

          Show
          Ankit Agarwal added a comment - This works as expected! Thanks
          Hide
          Dan Poltawski added a comment -

          Congratulations!

          You've made it into the weekly release!

          Thanks for your contribution - here are some random drummers to keep you inspired for the next week!
          http://www.youtube.com/watch?v=_QhpHUmVCmY

          Show
          Dan Poltawski added a comment - Congratulations! You've made it into the weekly release! Thanks for your contribution - here are some random drummers to keep you inspired for the next week! http://www.youtube.com/watch?v=_QhpHUmVCmY

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: