I am having big performance issue with jos_content database queries as the jos_content table grows, this is espacially caused by the large number of tables in the join. the table have more than 70k rows.
is there any plan to adress such situations ?
here are some queries logged with mysql slow query log.
cheers,
# Query_time: 25 Lock_time: 0 Rows_sent: 20 Rows_examined: 440972
use mydatabase;
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.ordering, a.featured, a.language, a.hits, a.publish_up, a.publish_down,l.title AS language_title,
uc.name AS editor,ag.title AS access_level,c.title AS category_title,
ua.name AS author_name
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_users AS ua ON
ua.id = a.created_by
WHERE (a.state = 0 OR a.state = 1)
ORDER BY a.title asc LIMIT 0, 20;
# Query_time: 38 Lock_time: 0 Rows_sent: 13900 Rows_examined: 201790
SELECT
a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by,
uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore ,CASE WHEN
badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE
ua.name END AS author,ua.email AS author_email,
contact.id as contactid,parent.title as parent_title,
parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count as rating_count,c.published, CASE WHEN
badcats.id is null THEN c.published ELSE 0 END AS parents_published
FROM jos_content AS a
LEFT JOIN jos_content_frontpage AS fp ON fp.content_id =
a.idLEFT 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_contact_details AS contact on contact.user_id = a.created_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
LEFT OUTER JOIN (SELECT
cat.id as id FROM jos_categories AS cat JOIN jos_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY
cat.id ) AS badcats ON
badcats.id =
c.id
WHERE a.access IN (1) AND CASE WHEN
badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2011-06-27 12:07:31') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2011-06-27 12:07:31')
ORDER BY c.path, CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END DESC , a.created;
--
http://tbela99.blogspot.com/
fax : (+33) 08 26 51 94 51