From a9f1c04ed23774fcd0830d3f6563ad0f04dd43c5 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 28 Nov 2013 20:14:46 +0100 Subject: [PATCH 1/2] 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. --- appinfo/update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appinfo/update.php b/appinfo/update.php index b89894d2..361dbd46 100644 --- a/appinfo/update.php +++ b/appinfo/update.php @@ -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', '<=')) { )); } -} \ No newline at end of file +} From 1ca71cf4b36c56ba7b8bf87d1bad36ad90b4ea67 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 28 Nov 2013 20:21:03 +0100 Subject: [PATCH 2/2] remove newline at end of file (editor added that automatically) --- appinfo/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/update.php b/appinfo/update.php index 361dbd46..18ed6554 100644 --- a/appinfo/update.php +++ b/appinfo/update.php @@ -28,4 +28,4 @@ if (version_compare($installedVersion, '0.7', '<=')) { )); } -} +} \ No newline at end of file