aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Hq.php6
-rw-r--r--Zotlabs/Module/Ping.php8
2 files changed, 10 insertions, 4 deletions
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index c305fdb3b..c46695b65 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -51,9 +51,11 @@ class Hq extends \Zotlabs\Web\Controller {
$item_normal = item_normal();
$item_normal_update = item_normal_update();
+ $use_index = db_use_index('created');
+
if(! $item_hash) {
- $r = q("SELECT mid FROM item
- WHERE uid = %d
+ $r = q("SELECT mid FROM item $use_index
+ WHERE uid = %d $item_normal
AND mid = parent_mid
ORDER BY created DESC LIMIT 1",
intval(local_channel())
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index a3f6cdfec..f8399d871 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -320,7 +320,9 @@ class Ping extends \Zotlabs\Web\Controller {
if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) {
$result = array();
- $r = q("SELECT * FROM item
+ $use_index = db_use_index('uid_item_unseen');
+
+ $r = q("SELECT * FROM item $use_index
WHERE item_unseen = 1 and uid = %d $item_normal
AND author_xchan != '%s'
ORDER BY created DESC limit 300",
@@ -492,8 +494,10 @@ class Ping extends \Zotlabs\Web\Controller {
$t3 = dba_timer();
if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) {
+
+ $use_index = db_use_index('uid_item_unseen');
- $r = q("SELECT id, item_wall FROM item
+ $r = q("SELECT id, item_wall FROM item $use_index
WHERE item_unseen = 1 and uid = %d
$item_normal
AND author_xchan != '%s'",