-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the loading speed of category items #19261
Conversation
68df4c6
to
63b1a4a
Compare
Does this can help us on joomla 3.8.X timeload ? it seem to be for category view but that impact com_content, so i'm ready to test everything you can ask |
I have read your issue and this PR is probably not directly related to your problem. This PR required 2 successful test to be ready to commit. I have plan to fix your issue too, please test this one. It will help me to move forward faster. |
Hi csthomas, i will try to manage to test this fix too, i'm currently experiencing trouble with PhpmyAdmin on last Xampp release, so i will need a bit of time to workaround that issue, when this will be done, i'll test the patch, thank a lot to help us, we are ready to help at our best just ask us if anything is needed. |
from a quick test on postgresql with 100 cats the query plan seems better but the performance gain are neglibile, |
I created 400 categories and 4000 articles by modified version of sampledata blog plugin, ex https://gist.github.com/csthomas/df973e13245e6a23ed5f8cb9ecd67ce1 |
In general, if there are more articles, the difference in speed should be more visible. Total articles should be more than 4000. |
well i've tested with 16000 articles with 100 category, but maybe is better to test on mysql should be most impacted cause different implementation on subquery |
@alikon Did you go to |
i've tested this url http://localhost/test/index.php/component/content/categories only |
I have tested this item ✅ successfully on 63b1a4a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19261. |
i've tested on MySQLi 5.7.20 not sure if in lower version the gain will be the same |
My screen shots are similar, so I do not send them. In general Mysql has a little problem with GROUP BY when there is a lots of columns (in SELECT). |
The similar improvement I added at #19284. Instead of DISTINCT I use join to subquery. |
} | ||
} | ||
|
||
// Note: i for item | ||
if ($this->_options['countItems'] == 1) | ||
{ | ||
$queryjoin = $db->quoteName($this->_table) . ' AS i ON i.' . $db->quoteName($this->_field) . ' = c.id'; | ||
$subQuery = $db->getQuery(true) | ||
->select('COUNT(i.' . $db->quoteName($this->_key) . ') AS numitems') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove AS numitems
since its value is aliased later on.
SELECT COUNT(i.`id`) AS numitems
FROM `ypqhy_content` AS `i`
WHERE i.`catid` = c.id
AND i.state = 1) AS numitems``
I have tested this item ✅ successfully on 9ab2931 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19261. |
MariaDB to 10.1.29 on SSD 11,000 articles in a single category Before this PR After this PR is applied |
Thank you folks for testing. |
@ggppdk can you please mark your Test as succcessfully? |
I have granted an FTP access to ggpdk to download the akeeba archive as he seem to have issue with backup using http, i would like also to thanks you all for your time and effort to get the best CMS f. |
I have tested this item ✅ successfully on 9ab2931 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19261. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19261. |
Yiannis seem busy so I update the thread he have applied PR 19261 and PR 19284 pagetime load went from 4.5sec in joomla 3.7.5 to 3.5 sec in Joomla 3.8.3 (9 sec without PR), and start display page is 2.4 sec, for user Pagespeed load is 1.7 sec !!!!!!!!!! so its a wonderdull success !!!!!, I wand to sincerelly thanks Csthomas for is fantastic work ! and of course Georgios (ggppdk) who offer me is help, and all the Joomla devs, if I can exprim myself on the internet its because I discovered Joomla 8 year ago, I want to thank you all. You have to know that there is a lot of people using your code, and you make our life better, joomla 3.8.4 update will be awesome for user, just take a look : https://www.crashdebug,fr navigate througth the site and found a page not in cache (using left menu, and navigation bar at the bottom) they are displayed quasi instantly, you made it guys !!!!! Joomla is now as fast as wordpress with 14k article !!!! Thanks, Guillaume |
Summary of Changes
Faster loading of category items in component content view categories.
Instead of using a query with
GROUP BY
this PR usesDEPENDENT SUBQUERY
.Testing Instructions
Joomla works as before.
On large content sites, categories view in component
content
loads faster.Test on
index.php/component/content/categories
.Enable debug mode.
Look for the query that contains
c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time
andnumitems
.Expected result
Categories load faster on view categories.