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
Very slow article list query on MariaDB 10.2 with many articles when “Content - Vote“ plugin is enabled #23090
Comments
This comment was marked as abuse.
This comment was marked as abuse.
@teoteo Only for test, can you remove the |
I’ll clean the 4000 rows of user data and I’ll send you the interested tables, thanks.
You are right: SELECT a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid, a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits, a.publish_up, a.publish_down, a.note,l.title AS language_title, l.image AS language_image,uc.name AS editor,ag.title AS access_level,c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level,parent.title AS parent_category_title, parent.id AS parent_category_id,
parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level,ua.name AS author_name,COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count,COUNT(asso2.id)>1 as association
FROM jos_content AS a
LEFT JOIN `jos_languages` AS l
ON l.lang_code = a.language
LEFT JOIN jos_users AS uc
ON uc.id=a.checked_out
LEFT JOIN jos_viewlevels AS ag
ON ag.id = a.access
LEFT JOIN jos_categories AS c
ON c.id = a.catid
LEFT JOIN jos_categories AS parent
ON parent.id = c.parent_id
LEFT JOIN jos_users AS ua
ON ua.id = a.created_by
LEFT JOIN jos_content_rating AS v
ON a.id = v.content_id
LEFT JOIN jos_associations AS asso
ON asso.id = a.id
AND asso.context='com_content.item'
LEFT JOIN jos_associations AS asso2
ON asso2.key = asso.key
WHERE (a.state = 0 OR a.state = 1)
GROUP BY a.id
ORDER BY a.id desc
LIMIT 20 takes 0.0030 seconds on tested system 1! |
@csthomas as your Suggestions works is there a PR for 4.0 coming or closing the Issue? |
@csthomas reminder. |
This comment was marked as abuse.
This comment was marked as abuse.
If there is something I can test, I manage a site with about 13000 articles and 5 content languages. |
This should already be fixed in 4.0, see #26465. I guess this could be backported to 3.x too. |
OK, working on it. |
See #27338 for removing group clause. |
For removing |
Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/23090 |
Steps to reproduce the issue
Expected result
A quick list of articles in 1-2 seconds
Actual result
I have to wait more than a minute to get the listed article
System information (as much as possible)
Tested System 1
With some load because it is a production server
Tested System 2
Tested system 3
Joomla! version:
3.9.0
PHP version
5.6.38
Additional comments
The same site on the same server, with MariaDB 10.0 and 10.1 or on another system with MySQL 5.7.23 the artilce list is fast.
Checkin the longest queries, I can see this:
Selecting in phpMyAdmin the table jos_contents and executing the query, I get:
Tested system 1: Query took 58.0740 seconds"
Tested system 2: Query took 48.6852 seconds"
Tested system 3: Query took 0.9777 seconds"
Disabling “Content - Vote plugin” plugin
the query changes in
Selecting in phpMyAdmin the table jos_contents and executing the query, I get:
Tested system 2: Query took 0.7925 seconds"
Tested system 1: Query took 0.7869 seconds"
Tested system 3: Query took 0.5500 seconds"
Using the "Profile" function of phpMyAdmin I get a lot of time removing duplicates.
Is the
part of the query problematic on MariaDB 10.2?
The text was updated successfully, but these errors were encountered: