PDA

View Full Version : homepage can not be opened after data imported


tvv
05-22-2007, 05:32 PM
We just installed fresh copy of v3.5, and imported our 150k+ articles into vivvo, then...

homepage can not be opened.

I checked in mysql and found the magic sql statement is:

SELECT a . *
FROM tblArticles AS a
LEFT JOIN tblComments AS c ON a.id = c.article_id
LEFT JOIN tblUsers AS u ON u.username = a.author
LEFT JOIN tblRelated AS r ON r.id_rel = a.id
WHERE (
a.created <= '2007-05-22 23:59:59'
)
AND (
a.status = '1'
)
GROUP BY a.id
ORDER BY a.times_read DESC
LIMIT 0 , 4

and after using mysql explain, it shows:

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE c system NULL NULL NULL NULL 0 const row not found
1 SIMPLE r system NULL NULL NULL NULL 0 const row not found
1 SIMPLE a ALL NULL NULL NULL NULL 150000 Using where; Using temporary; Using filesort
1 SIMPLE u ALL NULL NULL NULL NULL 2

that means it table scan the biggest article table for 5 articles.

so it takes for ever to load our homepage...

and also, at admin page, it takes more than 10 seconds to see the first page of article list...

so I really concerned about the performance of vivvo, pages are so slow to be opened even none of our tons of thousands of visitors here...

anyone has solution?

utvara
05-23-2007, 12:22 PM
We are aware of that issue, please contact vivvo support at support@vivvo.net so we can deploy you the patch.

tvv
05-24-2007, 07:09 PM
you know what? I just felt the sql statement is quite funny, it links to several tables to slow down itself, but actually its condition and return values are ALL tblArticles, and since id is primary key in the table, 'group by' doesn't make any sense at all...

SELECT a . *
FROM tblArticles AS a
LEFT JOIN tblComments AS c ON a.id = c.article_id
LEFT JOIN tblUsers AS u ON u.username = a.author
LEFT JOIN tblRelated AS r ON r.id_rel = a.id
WHERE (
a.created <= '2007-05-22 23:59:59'
)
AND (
a.status = '1'
)
GROUP BY a.id
ORDER BY a.times_read DESC
LIMIT 0 , 4