Performance: Avoid queries where there is no media or category
This commit is contained in:
parent
69984ac6bc
commit
4daae255d8
6 changed files with 28 additions and 6 deletions
|
@ -55,7 +55,7 @@
|
|||
use Friendica\Database\DBA;
|
||||
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1463);
|
||||
define('DB_UPDATE_VERSION', 1464);
|
||||
}
|
||||
|
||||
return [
|
||||
|
|
|
@ -194,6 +194,8 @@
|
|||
"question-multiple" => ["post-question", "multiple"],
|
||||
"question-voters" => ["post-question", "voters"],
|
||||
"question-end-time" => ["post-question", "end-time"],
|
||||
"has-categories" => "EXISTS(SELECT `uri-id` FROM `post-category` WHERE `post-category`.`uri-id` = `post-user`.`uri-id` AND `post-category`.`uid` = `post-user`.`uid`)",
|
||||
"has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-user`.`uri-id`)",
|
||||
"signed_text" => ["diaspora-interaction", "interaction"],
|
||||
"parent-guid" => ["parent-item-uri", "guid"],
|
||||
"parent-network" => ["parent-post", "network"],
|
||||
|
@ -361,6 +363,8 @@
|
|||
"question-multiple" => ["post-question", "multiple"],
|
||||
"question-voters" => ["post-question", "voters"],
|
||||
"question-end-time" => ["post-question", "end-time"],
|
||||
"has-categories" => "EXISTS(SELECT `uri-id` FROM `post-category` WHERE `post-category`.`uri-id` = `post-thread-user`.`uri-id` AND `post-category`.`uid` = `post-thread-user`.`uid`)",
|
||||
"has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread-user`.`uri-id`)",
|
||||
"signed_text" => ["diaspora-interaction", "interaction"],
|
||||
"parent-guid" => ["parent-item-uri", "guid"],
|
||||
"parent-network" => ["parent-post", "network"],
|
||||
|
@ -494,6 +498,8 @@
|
|||
"question-multiple" => ["post-question", "multiple"],
|
||||
"question-voters" => ["post-question", "voters"],
|
||||
"question-end-time" => ["post-question", "end-time"],
|
||||
"has-categories" => "0",
|
||||
"has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post`.`uri-id`)",
|
||||
"signed_text" => ["diaspora-interaction", "interaction"],
|
||||
"parent-guid" => ["parent-item-uri", "guid"],
|
||||
"parent-network" => ["parent-post", "network"],
|
||||
|
@ -623,6 +629,8 @@
|
|||
"question-multiple" => ["post-question", "multiple"],
|
||||
"question-voters" => ["post-question", "voters"],
|
||||
"question-end-time" => ["post-question", "end-time"],
|
||||
"has-categories" => "0",
|
||||
"has-media" => "EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread`.`uri-id`)",
|
||||
"signed_text" => ["diaspora-interaction", "interaction"],
|
||||
"parent-guid" => ["parent-item-uri", "guid"],
|
||||
"parent-network" => ["parent-post", "network"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue