Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: JComments latest slows down the web
Pages: [1]   Go Down
  Print  
Author Topic: JComments latest slows down the web  (Read 821 times)
0 Members and 2 Guests are viewing this topic.
Revoluce
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« on: October 20, 2010, 18:16:51 »

Hello,

I am using the JComments 2.2.0.0 [13/05/2010] with latest comments module. I have huge database of comments (about 90 000) on my web transfered from my old Mambo site. Everything works fine, but when I use the latest comment module, I have a lot issues in my MYSQL slow log. I think that module looks up through the whole database to find the last seven comments, and It causes the problem, because database is too big.

However, I am not able to find a way to fix this. I am not a programmer, so I tried to politely ask, if someone doesnt know the solution for this. I think there could be way to force the module to look only in - for example - one week old comments? This could reduce the number of queries and could make this module usable even for big amounts of comment?

Would there be anyone who could help? This would be great! Thanks in advance!

Down there is typical problem in MYSQL slow log for this issue:

# Time: 101020 12:06:00
# User@Host: silvarium1[silvarium1] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 7  Rows_examined: 84954
SELECT c.id AS id, c.title AS title, c.sectionid, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug, CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug
, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate
 FROM jos_content AS c
 LEFT JOIN jos_jcomments AS cc ON c.id = cc.object_id
 LEFT JOIN jos_categories AS ct ON ct.id = c.catid
 WHERE c.state = 1
   AND c.access <= '0'
   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= '2010-10-20 10:05:49')
   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= '2010-10-20 10:05:49')
   AND cc.published = 1
   AND cc.object_group = 'com_content'
 GROUP BY c.id, c.title, c.sectionid, slug, catslug
 ORDER BY commentdate DESC
 LIMIT 7;
# User@Host: silvarium1[silvarium1] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 7  Rows_examined: 84954
SELECT c.id AS id, c.title AS title, c.sectionid, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug, CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug
, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate
 FROM jos_content AS c
 LEFT JOIN jos_jcomments AS cc ON c.id = cc.object_id
 LEFT JOIN jos_categories AS ct ON ct.id = c.catid
 WHERE c.state = 1
   AND c.access <= '0'
   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= '2010-10-20 10:05:49')
   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= '2010-10-20 10:05:49')
   AND cc.published = 1
   AND cc.object_group = 'com_content'
 GROUP BY c.id, c.title, c.sectionid, slug, catslug
 ORDER BY commentdate DESC
 LIMIT 7;

Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: October 21, 2010, 19:06:33 »

These queries are outputs list of latest commented articles and count of their comments. To dispaly the comments counter we need to select all comments for these articles and group them by article's ID. This isn't to fast operation.

Now I'm workin' on new version and it would be quite light and faster. I couldn't promise that it will solve all performance issues but it will be better. With new JComments version I'm going to release new version of JComments Latest and it would be also faster.

At this moment I could suggest you to increase module's cache time to reduce module calls and query execution.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: JComments latest slows down the web
 
Jump to: