From: Aaron Schulz Date: Wed, 12 Aug 2015 22:37:57 +0000 (-0700) Subject: Optimized notification timestamp clearing X-Git-Tag: 1.31.0-rc.0~10443^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=a15cf051885b932bc8ad0a459a2ee3eda6190143;p=lhc%2Fweb%2Fwiklou.git Optimized notification timestamp clearing * Hint that mariadb can avoid scanning already NULL rows since we want to set them all to NULL. This lets the index with the timestamp be used, which avoids logs of scanning for users with many rows. For non-parallel replication, this also avoids slave lag in particular. Bug: T107923 Change-Id: I8cded5476ef6adb2f8fea57239afd6e9b2a49708 --- diff --git a/includes/User.php b/includes/User.php index 665a68955c..9b958f42dd 100644 --- a/includes/User.php +++ b/includes/User.php @@ -3459,7 +3459,7 @@ class User implements IDBAccessObject { $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => null ), - array( /* WHERE */ 'wl_user' => $id ), + array( /* WHERE */ 'wl_user' => $id, 'wl_notificationtimestamp IS NOT NULL' ), __METHOD__ ); // We also need to clear here the "you have new message" notification for the own user_talk page; diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 910fe259f1..3d688138af 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -102,7 +102,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { case self::EDIT_NORMAL: default: - $this->executeViewEditWatchlist(); + $this->executeViewEditWatchlist(); break; } }