Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: 1.9
-
Component/s: Administration
-
Labels:None
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
Under big sites, the deletion of old cache_text records can be really long.
I would propose to add one index to the timemodified field ASAP. I've tested that in a BIG-BIG site and differences are noticeable. It will cause a small delay on inserts, but I haven't been able to percept it.
Ciao ![]()
if ($oldcacheitem = get_record_sql('SELECT * FROM '.$CFG->prefix.'cache_text WHERE md5key = \''.$md5key.'\'', true)) {
if ($oldcacheitem->timemodified >= $time) { return $oldcacheitem->formattedtext; }
}
I guess we could then use the timemodified in this query too - could be faster there too, right?