define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1195 );
+define ( 'DB_UPDATE_VERSION', 1196 );
/**
* @brief Constant with a HTML line break.
-- ------------------------------------------
-- Friendica 3.5-dev (Asparagus)
--- DB_UPDATE_VERSION 1195
+-- DB_UPDATE_VERSION 1196
-- ------------------------------------------
INDEX `extid` (`extid`),
INDEX `uid_id` (`uid`,`id`),
INDEX `uid_created` (`uid`,`created`),
- INDEX `uid_unseen` (`uid`,`unseen`),
+ INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`),
INDEX `uid_received` (`uid`,`received`),
INDEX `uid_network_commented` (`uid`,`network`,`commented`),
"extid" => array("extid"),
"uid_id" => array("uid","id"),
"uid_created" => array("uid","created"),
- "uid_unseen" => array("uid","unseen"),
+ "uid_unseen_contactid" => array("uid","unseen","contact-id"),
"uid_network_received" => array("uid","network","received"),
"uid_received" => array("uid","received"),
"uid_network_commented" => array("uid","network","commented"),
function groups_count_unseen() {
$r = q("SELECT `group`.`id`, `group`.`name`,
- (SELECT COUNT(*) FROM `item`
+ (SELECT COUNT(*) FROM `item` FORCE INDEX (`uid_unseen_contactid`)
WHERE `uid` = %d AND `unseen` AND
`contact-id` IN (SELECT `contact-id` FROM `group_member`
WHERE `group_member`.`gid` = `group`.`id` AND `group_member`.`uid` = %d)) AS `count`
$r = q("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network`,
`thread`.`uid` AS `contact-uid`
- FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
+ FROM `thread` FORCE INDEX (`uid_created`) INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
$sql_post_table INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
WHERE `thread`.`uid` = %d AND `thread`.`visible` = 1 AND `thread`.`deleted` = 0
<?php
-define('UPDATE_VERSION' , 1195);
+define('UPDATE_VERSION' , 1196);
/**
*