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

Implement a check_database_schema performance check

XMLWordPrintable

    • MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-67822-schema-check
    • 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);      

      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. 

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Kevin Pham Kevin Pham
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.