Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2108

Performance - Joomla! 4.x • mod_logged performence optimize in big sites

$
0
0
Hi Joomla 4.4.4
Big site with 130 000 rows is table #__session

administrator/modules/mod_logged/src/Helper/LoggedHelper.php


ROW 45

Code:

        $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);
Replace it with this:

Code:

        $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

Statistics: Posted by Vrut — Wed May 15, 2024 3:29 pm



Viewing all articles
Browse latest Browse all 2108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>