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
This commit is contained in:
@@ -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'])
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user