Moodle

Perfomance deleting course

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.1
  • Fix Version/s: 1.6.2, 1.7
  • Component/s: Course
  • Labels:
    None
  • Environment:
    All
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_16_STABLE
  • Fixed Branches:
    MOODLE_16_STABLE, MOODLE_17_STABLE

Description

On ??? site course deleting very long.

Very long there is a select of deleted data in the table mdl_qusestions_sessions on a field questionid.

A field questionid has not index.

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Alex Djachenko (alex-pub at my-site.ru) Wednesday, 16 August 2006, 10:30 PM:

And field parent in table mdl_question

Show
Martin Dougiamas added a comment - From Alex Djachenko (alex-pub at my-site.ru) Wednesday, 16 August 2006, 10:30 PM: And field parent in table mdl_question
Hide
Mike Churchward added a comment -

I've seen this stop completely and never complete. It happens in the 'remove_course_contents' function when it includes the 'questionlib' and calls the 'question_delete_course'. At this point, the course deletion will not complete.

Show
Mike Churchward added a comment - I've seen this stop completely and never complete. It happens in the 'remove_course_contents' function when it includes the 'questionlib' and calls the 'question_delete_course'. At this point, the course deletion will not complete.
Hide
Mike Churchward added a comment -

In my case, it dies on a "DELETE FROM mdl_question_sessions WHERE questionid = '2457'" sql statement. It seems to keep re-executing it. In this case, there are no records to delete.

Show
Mike Churchward added a comment - In my case, it dies on a "DELETE FROM mdl_question_sessions WHERE questionid = '2457'" sql statement. It seems to keep re-executing it. In this case, there are no records to delete.
Hide
Mike Churchward added a comment -

I think I have it figured... In '/lib/questionlib.php', on line 377 there is a recursive call to 'delete_question'. For the site I'm looking at, this continually calls the function with the same id. The problem here seems to be that both the 'id' and the 'parent' field of this question are the same, so it never stops.

I'm not sure how to fix it, because I'm not sure if the id and parent fields should ever be the same. We could add a check for this and carry on when they're equal.

Show
Mike Churchward added a comment - I think I have it figured... In '/lib/questionlib.php', on line 377 there is a recursive call to 'delete_question'. For the site I'm looking at, this continually calls the function with the same id. The problem here seems to be that both the 'id' and the 'parent' field of this question are the same, so it never stops. I'm not sure how to fix it, because I'm not sure if the id and parent fields should ever be the same. We could add a check for this and carry on when they're equal.
Hide
Eloy Lafuente (stronk7) added a comment -

Great work, Mike. Assigning this with Tim (if I'm not wrong).

Show
Eloy Lafuente (stronk7) added a comment - Great work, Mike. Assigning this with Tim (if I'm not wrong).
Hide
Mike Churchward added a comment -

Looks like its already fixed... I wasn't looking at the latest version. The latest version has code to deal with this. You can probably close this one.

Show
Mike Churchward added a comment - Looks like its already fixed... I wasn't looking at the latest version. The latest version has code to deal with this. You can probably close this one.
Hide
Tim Hunt added a comment -

This was solved by the fix to MDL-6267

Show
Tim Hunt added a comment - This was solved by the fix to MDL-6267

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: