#320 Permanent deletion of events fails because of high memory requirement

open
nobody
None
5
2013-07-04
2013-07-04
codifex
No

When trying to delete events permanently ("purge.php") based on date selection, the error message "Error executing query" (without any additional error information) appears.

I have tracked down the error to these lines in "purge.php":

    $E_ids = get_ids ( 'SELECT we.cal_id FROM webcal_entry we, webcal_entry_user weu ' .
      "WHERE cal_type = 'E' AND cal_date < '$end_date' $tail",
      $ALL );

It seems that joining the two tables requires a lot of memory (I am trying to delete 6,000+ events), making the query fail.

As I am not very familiar with SQL, I am wondering if the lines above could be safely replaced with the code below without breaking the feature (they do not cause the abovementioned error):

    $E_ids = get_ids ( 'SELECT we.cal_id FROM webcal_entry we JOIN webcal_entry_user weu ON we.cal_id = weu.cal_id ' .
      "WHERE cal_type = 'E' AND cal_date < '$end_date' $tail",
       $ALL );

Discussion