Slow Queries then "Lates News" Module is active

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
FlyingBell
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Dec 05, 2017 8:40 pm

Slow Queries then "Lates News" Module is active

Post by FlyingBell » Tue Dec 05, 2017 8:43 pm

Hello everybody,

i have one major performance with my joomla website. If i activate the "Lates-News"Module and set it to 25 articles, then i get a very slow querie. The debug mode shows:

Sending data 350.33 ms
Creating sort index 3.10 ms

for:

Code: Select all

SELECT DISTINCT a.id, a.title, a.alias, a.introtext, a.fulltext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias,
CASE WHEN c.published = 2
AND a.state > 0 THEN 2 WHEN c.published != 1 THEN 0 ELSE a.state END as state,
CASE WHEN a.modified = '0000-00-00 00:00:00' THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,
CASE WHEN a.publish_up = '0000-00-00 00:00:00' THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, a.language, LENGTH(a.fulltext) AS readmore,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,c.published, c.published AS parents_published,
CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count

FROM jos_content AS a

LEFT JOIN jos_categories AS c
ON c.id = a.catid

LEFT JOIN jos_users AS ua
ON ua.id = a.created_by

LEFT JOIN jos_users AS uam
ON uam.id = a.modified_by

LEFT JOIN jos_categories as parent
ON parent.id = c.parent_id

LEFT JOIN jos_content_rating AS v
ON a.id = v.content_id

WHERE a.access IN (1,1,5)
AND c.access IN (1,1,5)
AND c.published = 1
AND a.state = 1
AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2017-12-05 16:26:50')
AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2017-12-05 16:26:50')

ORDER BY a.created DESC
LIMIT 25
What can I do now to get a better performance?

Thank you very much =)

FlyingBell
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Dec 05, 2017 8:40 pm

Re: Slow Queries then "Lates News" Module is active

Post by FlyingBell » Wed Dec 06, 2017 5:08 pm

Does nobody have an idea what to do? The site has about 10.000+ articles and the problem occurs also if i activate "Similar articles" module or "Newsflash" Module. Is this a joomla core problem?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 25874
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Slow Queries then "Lates News" Module is active

Post by Per Yngve Berg » Thu Dec 07, 2017 5:14 pm

Mod. Note: Relocated the topic to the Performance Forum.

Is there an index on a.created that can be used by the query?

FlyingBell
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Dec 05, 2017 8:40 pm

Re: Slow Queries then "Lates News" Module is active

Post by FlyingBell » Sat Dec 09, 2017 7:32 pm

Hi Per Yngve Berg,

thanks for your answer. I have an index there, but it seems that the index can´t be used. How can I find out that it is the "a.created" index?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 25874
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Slow Queries then "Lates News" Module is active

Post by Per Yngve Berg » Sat Dec 09, 2017 8:11 pm

You can see it in phpmyadmin or another Mysql tool.

FlyingBell
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Dec 05, 2017 8:40 pm

Re: Slow Queries then "Lates News" Module is active

Post by FlyingBell » Sun Dec 10, 2017 11:21 am

Yes I have the following index on the created column:

created BTREE No No created 7219 A Nein

Type is BTREE. Is that the correct index?


Post Reply

Return to “Performance - Joomla! 3.x”