]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Upgrade script for Bookmark uses joins instead of exists (performance++)
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Mar 2016 10:48:00 +0000 (12:48 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Mar 2016 10:48:00 +0000 (12:48 +0200)
plugins/Bookmark/BookmarkPlugin.php

index 780acfcbbc4ca8bd18debfc396a2b81ff5357a78..050e529e0d551997b1fa7a9b184d70cac7f90955 100644 (file)
@@ -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();