remove unnecessary sub-select

member_id is the primary key and therefore unique => the nested select statement is not necessary and only adds additional computational overhead on the db.
This commit is contained in:
daniel 2013-11-28 20:14:46 +01:00
parent 9ab3c0cbce
commit a9f1c04ed2

View File

@ -11,7 +11,7 @@
$installedVersion = \OCP\Config::getAppValue('documents', 'installed_version');
$cleanup = \OC_DB::prepare('DELETE FROM `*PREFIX*documents_member` WHERE `member_id` NOT IN(SELECT `member_id` from `*PREFIX*documents_member` WHERE `last_activity`>0)');
$cleanup = \OC_DB::prepare('DELETE FROM `*PREFIX*documents_member` WHERE `last_activity`=0 or `last_activity` is NULL');
$cleanup->execute();
if (version_compare($installedVersion, '0.7', '<=')) {
@ -28,4 +28,4 @@ if (version_compare($installedVersion, '0.7', '<=')) {
));
}
}
}