aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Ping.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-01-28 12:09:47 +0100
committerMario Vavti <mario@mariovavti.com>2018-01-28 12:09:47 +0100
commita86b260f736cd7298d5d160c658bb9405ad3f69f (patch)
tree38ebc468bac5284e7ab5baf77a9e54fe8d231d59 /Zotlabs/Module/Ping.php
parent423274b9230ced36a3a659b8518c94d7b17ef107 (diff)
downloadvolse-hubzilla-a86b260f736cd7298d5d160c658bb9405ad3f69f.tar.gz
volse-hubzilla-a86b260f736cd7298d5d160c658bb9405ad3f69f.tar.bz2
volse-hubzilla-a86b260f736cd7298d5d160c658bb9405ad3f69f.zip
query optimisations for notifications - use a specific index only
Diffstat (limited to 'Zotlabs/Module/Ping.php')
-rw-r--r--Zotlabs/Module/Ping.php8
1 files changed, 6 insertions, 2 deletions
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'",