X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fphotos.php;h=9d8d3309c2bb49d0abce8e5e8a68e653021d5bc0;hb=0989f725a6e943a5abb21a9adb14edf212221403;hp=7cdd14bf6d3e586894748de06292c933f7173058;hpb=414c5ddae08ca3a49ce570b481f2656fd0a58ea0;p=friendica.git diff --git a/include/photos.php b/include/photos.php index 7cdd14bf6d..9d8d3309c2 100644 --- a/include/photos.php +++ b/include/photos.php @@ -49,7 +49,7 @@ function photo_albums($uid, $update = false) { /// @todo This query needs to be renewed. It is really slow // At this time we just store the data in the cache $albums = qu("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album` - FROM `photo` USE INDEX (`uid_album_created`) + FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra GROUP BY `album` ORDER BY `created` DESC", intval($uid), @@ -59,7 +59,7 @@ function photo_albums($uid, $update = false) { } else { // This query doesn't do the count and is much faster $albums = qu("SELECT DISTINCT(`album`), '' AS `total` - FROM `photo` USE INDEX (`uid_album_created`) + FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra GROUP BY `album` ORDER BY `created` DESC", intval($uid),