The tag query should be much faster now

This commit is contained in:
Michael 2018-02-26 06:59:32 +00:00
parent d2728cad2e
commit fe68e99c7c
4 changed files with 5 additions and 3 deletions

View file

@ -39,7 +39,7 @@ define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Asparagus');
define('FRIENDICA_VERSION', '3.6-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1254);
define('DB_UPDATE_VERSION', 1255);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/**

View file

@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 3.6-dev (Asparagus)
-- DB_UPDATE_VERSION 1254
-- DB_UPDATE_VERSION 1255
-- ------------------------------------------
@ -512,6 +512,7 @@ CREATE TABLE IF NOT EXISTS `item` (
INDEX `uid_id` (`uid`,`id`),
INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
INDEX `uid_created` (`uid`,`created`),
INDEX `uid_commented` (`uid`,`commented`),
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`),
INDEX `uid_network_commented` (`uid`,`network`,`commented`),

View file

@ -818,7 +818,7 @@ function networkThreadedView(App $a, $update = 0)
}
$items = dba::p("SELECT `item`.`uri`, `item`.`id` AS `item_id`, `item`.$ordering AS `order_date` FROM `item`
INNER JOIN (SELECT `oid` FROM `term` WHERE `term` IN
STRAIGHT_JOIN (SELECT `oid` FROM `term` WHERE `term` IN
(SELECT SUBSTR(`term`, 2) FROM `search` WHERE `uid` = ? AND `term` LIKE '#%') AND `otype` = ? AND `type` = ? AND `uid` = 0) AS `term`
ON `item`.`id` = `term`.`oid`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`author-id`

View file

@ -1191,6 +1191,7 @@ class DBStructure
"uid_id" => ["uid","id"],
"uid_contactid_id" => ["uid","contact-id","id"],
"uid_created" => ["uid","created"],
"uid_commented" => ["uid","commented"],
"uid_unseen_contactid" => ["uid","unseen","contact-id"],
"uid_network_received" => ["uid","network","received"],
"uid_network_commented" => ["uid","network","commented"],