From: Mikael Nordfeldth Date: Tue, 29 Mar 2016 10:48:00 +0000 (+0200) Subject: Upgrade script for Bookmark uses joins instead of exists (performance++) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f8765c6166601811a60cc6dbea43f654d594fe4d;p=quix0rs-gnu-social.git Upgrade script for Bookmark uses joins instead of exists (performance++) --- diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 780acfcbbc..050e529e0d 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -355,8 +355,8 @@ class BookmarkPlugin extends MicroAppPlugin $notice = new Notice(); - $notice->whereAdd('exists (select uri from bookmark where bookmark.uri = notice.uri)'); - $notice->whereAdd('((object_type is null) or (object_type = "' .ActivityObject::NOTE.'"))'); + $notice->joinAdd(array('uri', 'bookmark:uri')); + $notice->whereAdd('object_type IS NULL OR object_type = '.$notice->escape(ActivityObject::NOTE)); $notice->find();