System with large number of guest sessions very slow.
Also query does not use ORDER BY so no guarantee last X logged in users will be shown.
Joomla 3.8.10
MySQL 5.5.52
Suggest changing WHERE clause in getList() method in ModLoggedHelper to
$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.userid > 0') // Added, uses existing index
->where('s.guest = 0')
->order('s.time DESC'); // Added, guarantees last X rows returned
Labels |
Added:
?
|
Category | ⇒ | com_admin |
Status | New | ⇒ | Discussion |
Remove WHERE
clause and replace LEFT JOIN
with INNER JOIN
.
Labels |
Added:
J3 Issue
|
@franz-wohlkoenig can be closed as we have a pr #23650
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-10 12:21:01 |
Closed_By | ⇒ | franz-wohlkoenig |
This issue also affects mod_status.
Need to add userid > 0 clause to all guest = 0 conditions
Putting an index on the 'guest' column will resolve this issue in both cases.
Could this be a better method that changing the code?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21555.