Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67822

Implement a check_database_schema performance check

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1) Run the existing cli check:

      $ php admin/cli/check_database_schema.php

      Confirm it is OK

      2) Run the new GUI version of this check:

      /report/performance/index.php

      Confirm it is ok

      3) Look at the details of this report:

      /report/performance/index.php?detail=core_dbschema

      Confirm it is ok

      4) Change the schema, eg in a db shell run:

      DROP INDEX mdl_extetoke_tok_ix;

      5) Run the existing cli check:

      $ php admin/cli/check_database_schema.php

      Confirm it shows the error:

      external_tokens

      • Missing index 'token' (not unique (token)).

      CREATE INDEX mdl_extetoke_tok_ix ON mdl_external_tokens (token);

      6) Run the new GUI version of this check:

      /report/performance/index.php

      Confirm it the error status and summary

      7) Click on 'Database schema check' to see the details of this report, or nav to:

      /report/performance/index.php?detail=core_dbschema

      8) Confirm it shows the error details like the cli

      external_tokens

      • Missing index 'token' (not unique (token)).

      CREATE INDEX mdl_extetoke_tok_ix ON mdl_external_tokens (token);

       

       

       

      Show
      1) Run the existing cli check: $ php admin/cli/check_database_schema.php Confirm it is OK 2) Run the new GUI version of this check: /report/performance/index.php Confirm it is ok 3) Look at the details of this report: /report/performance/index.php?detail=core_dbschema Confirm it is ok 4) Change the schema, eg in a db shell run: DROP INDEX mdl_extetoke_tok_ix; 5) Run the existing cli check: $ php admin/cli/check_database_schema.php Confirm it shows the error: external_tokens Missing index 'token' (not unique (token)). CREATE INDEX mdl_extetoke_tok_ix ON mdl_external_tokens (token); 6) Run the new GUI version of this check: /report/performance/index.php Confirm it the error status and summary 7) Click on 'Database schema check' to see the details of this report, or nav to: /report/performance/index.php?detail=core_dbschema 8) Confirm it shows the error details like the cli external_tokens Missing index 'token' (not unique (token)). CREATE INDEX mdl_extetoke_tok_ix ON mdl_external_tokens (token);      
    • Affected Branches:
      MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_400_STABLE
    • Pull Master Branch:
      MDL-67822-schema-check

      Description

      Wrap check_database_schema in a check and add it to the performance report at /report/performance/index.php

      This script is slow enough that it's probably better to get the check api to run it in a cron task and just report on it in the check api, including how stale the report is. 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              brendanheywood Brendan Heywood
              Peer reviewer:
              Kevin Pham Kevin Pham
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Nov/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 50 minutes
                  50m