aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Hq.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/Hq.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/Hq.php')
-rw-r--r--Zotlabs/Module/Hq.php6
1 files changed, 4 insertions, 2 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())