mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 05:25:15 +02:00
Speed improvements of queries
This commit is contained in:
parent
8adc1bd703
commit
2d1b261fad
3 changed files with 21 additions and 8 deletions
|
@ -70,7 +70,7 @@ function community_content(&$a, $update = 0) {
|
|||
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
|
||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
|
||||
`user`.`nickname`, `user`.`hidewall`
|
||||
FROM `item` FORCE INDEX (`received`) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
FROM `item` FORCE INDEX (`received`, `wall`) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
||||
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
|
||||
|
|
|
@ -277,7 +277,7 @@ function profile_content(&$a, $update = 0) {
|
|||
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
|
||||
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
|
||||
FROM `item` FORCE INDEX (created) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
FROM `item` FORCE INDEX (created, uid) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||
and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue