]> git.mxchange.org Git - friendica.git/commitdiff
Performance improvements in public timeline
authorMichael <heluecht@pirati.ca>
Tue, 8 Nov 2022 21:48:42 +0000 (21:48 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 8 Nov 2022 21:48:42 +0000 (21:48 +0000)
database.sql
src/Module/Api/Mastodon/Timelines/PublicTimeline.php
static/dbstructure.config.php
static/dbview.config.php

index 891b830a4391354c50940296c4f7a86a4bd1f512..9f96b7bbf3207fdf7823ac047b7672c087e0e173 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2022.12-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1487
+-- DB_UPDATE_VERSION 1488
 -- ------------------------------------------
 
 
@@ -1953,9 +1953,7 @@ CREATE VIEW `post-user-view` AS SELECT
        `parent-post-author`.`url` AS `parent-author-link`,
        `parent-post-author`.`name` AS `parent-author-name`,
        `parent-post-author`.`nick` AS `parent-author-nick`,
-       `parent-post-author`.`network` AS `parent-author-network`,
-       `parent-post-author`.`blocked` AS `parent-author-blocked`,
-       `parent-post-author`.`hidden` AS `parent-author-hidden`
+       `parent-post-author`.`network` AS `parent-author-network`
        FROM `post-user`
                        STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
@@ -2132,9 +2130,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT
        `parent-post`.`author-id` AS `parent-author-id`,
        `parent-post-author`.`url` AS `parent-author-link`,
        `parent-post-author`.`name` AS `parent-author-name`,
-       `parent-post-author`.`network` AS `parent-author-network`,
-       `parent-post-author`.`blocked` AS `parent-author-blocked`,
-       `parent-post-author`.`hidden` AS `parent-author-hidden`
+       `parent-post-author`.`network` AS `parent-author-network`
        FROM `post-thread-user`
                        INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
@@ -2278,9 +2274,7 @@ CREATE VIEW `post-view` AS SELECT
        `parent-post`.`author-id` AS `parent-author-id`,
        `parent-post-author`.`url` AS `parent-author-link`,
        `parent-post-author`.`name` AS `parent-author-name`,
-       `parent-post-author`.`network` AS `parent-author-network`,
-       `parent-post-author`.`blocked` AS `parent-author-blocked`,
-       `parent-post-author`.`hidden` AS `parent-author-hidden`
+       `parent-post-author`.`network` AS `parent-author-network`
        FROM `post`
                        STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
                        STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post`.`author-id`
@@ -2420,9 +2414,7 @@ CREATE VIEW `post-thread-view` AS SELECT
        `parent-post`.`author-id` AS `parent-author-id`,
        `parent-post-author`.`url` AS `parent-author-link`,
        `parent-post-author`.`name` AS `parent-author-name`,
-       `parent-post-author`.`network` AS `parent-author-network`,
-       `parent-post-author`.`blocked` AS `parent-author-blocked`,
-       `parent-post-author`.`hidden` AS `parent-author-hidden`
+       `parent-post-author`.`network` AS `parent-author-network`
        FROM `post-thread`
                        INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
                        STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread`.`author-id`
index 066c4b83faf5a67e0e1ed2c568487a5ef4053c46..769373ff29c394535e97a2ad85466540a6463d91 100644 (file)
@@ -58,7 +58,7 @@ class PublicTimeline extends BaseApi
                $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
 
                $condition = ['gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'private' => Item::PUBLIC,
-                       'network' => Protocol::FEDERATED, 'parent-author-blocked' => false, 'parent-author-hidden' => false];
+                       'network' => Protocol::FEDERATED, 'author-blocked' => false, 'author-hidden' => false];
 
                if ($request['local']) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
index 79b1539f86ca6b428f597d00e8276f813bbfb2d9..343cf30206d8ddc9fcfa779994cf3055626d920e 100644 (file)
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1487);
+       define('DB_UPDATE_VERSION', 1488);
 }
 
 return [
index 925f82462525f5866bb61ac8595d530fd4b5fa62..2452dc341b90dba023859a6a48210c909db4d77d 100644 (file)
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-nick" => ["parent-post-author", "nick"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-user`
                        STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-thread-user`
                        INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post`
                        STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
                        "parent-author-link" => ["parent-post-author", "url"],
                        "parent-author-name" => ["parent-post-author", "name"],
                        "parent-author-network" => ["parent-post-author", "network"],
-                       "parent-author-blocked" => ["parent-post-author", "blocked"],
-                       "parent-author-hidden" => ["parent-post-author", "hidden"],
                ],
                "query" => "FROM `post-thread`
                        INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`