aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Channel.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-02-04 20:42:40 +0100
committerMario Vavti <mario@mariovavti.com>2018-02-04 20:42:40 +0100
commit3cc756f3029e5f3b02008dac94a90e168d398c9a (patch)
treebc6b6cdc552ef119e0f7beb8b40e83ffe59798c7 /Zotlabs/Module/Channel.php
parent512f3a764361dde44e36fb72c105265d6df298ad (diff)
downloadvolse-hubzilla-3cc756f3029e5f3b02008dac94a90e168d398c9a.tar.gz
volse-hubzilla-3cc756f3029e5f3b02008dac94a90e168d398c9a.tar.bz2
volse-hubzilla-3cc756f3029e5f3b02008dac94a90e168d398c9a.zip
remove some never used indices which prevented our item queries to find the right query execution plan in mysql and adjust some queries to optimze the result
Diffstat (limited to 'Zotlabs/Module/Channel.php')
-rw-r--r--Zotlabs/Module/Channel.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 7c4c900a1..b7e18f954 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -239,7 +239,7 @@ class Channel extends \Zotlabs\Web\Controller {
if($load || ($checkjs->disabled())) {
if($mid) {
- $r = q("SELECT distinct parent AS item_id from item where mid like '%s' and uid = %d $item_normal
+ $r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
AND item_wall = 1 $sql_extra limit 1",
dbesc($mid . '%'),
intval(\App::$profile['profile_uid'])
@@ -249,13 +249,13 @@ class Channel extends \Zotlabs\Web\Controller {
}
}
else {
- $r = q("SELECT distinct id AS item_id, created FROM item
+ $r = q("SELECT id AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
WHERE uid = %d $item_normal
AND item_wall = 1 and item_thread_top = 1
AND (abook_blocked = 0 or abook.abook_flags is null)
$sql_extra $sql_extra2
- ORDER BY created DESC $pager_sql ",
+ ORDER BY created DESC, id $pager_sql ",
intval(\App::$profile['profile_uid'])
);
}