Big site with 130 000 rows is table #__session
administrator/modules/mod_logged/src/Helper/LoggedHelper.php
ROW 45
Code: Select all
$query = $db->getQuery(true)
->select('s.time, s.client_id, u.id, u.name, u.username')
->from('#__session AS s')
->join('LEFT', '#__users AS u ON s.userid = u.id')
->where('s.guest = 0')
->setLimit($params->get('count', 5), 0);
Code: Select all
$query = $db->getQuery(true)
->select('s.time, s.client_id, u.id, u.name, u.username')
->from('#__session AS s')
->join('INNER', '#__users AS u ON s.userid = u.id')
->where('s.guest = 0 AND s.userid > 0')
->setLimit($params->get('count', 5), 0);
Original code load when you go to administration
/administrator/index.php
after login 5.2 seconds... (module latest logged users)
New code load admin in 160 ms.
Ad this code to all Joomla for better performance.
Thanks