Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.1k views
in Q2A Core by

Please check  below query its making server slow 

How can resolve it ?

SELECT qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1) AS basetype, INSTR(qa_posts.type, '_HIDDEN')>0 AS hidden, qa_posts.acount, qa_posts.selchildid, qa_posts.closedbyid, qa_posts.upvotes, qa_posts.downvotes, qa_posts.netvotes, qa_posts.views, qa_posts.hotness, qa_posts.flagcount, qa_posts.title, qa_posts.tags, UNIX_TIMESTAMP(qa_posts.created) AS created, qa_posts.name, qa_categories.title AS categoryname, qa_categories.backpath AS categorybackpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid) AS categoryids, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip) AS createip, qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email AS email, qa_users.handle AS handle, BINARY qa_users.avatarblobid AS avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, score FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN (SELECT postid, SUM(score)+LOG(postid)/1000000 AS score FROM ((SELECT qa_titlewords.postid, LOG(10000/titlecount) AS score FROM qa_titlewords JOIN qa_words ON qa_titlewords.wordid=qa_words.wordid JOIN qa_titlewords AS source ON qa_titlewords.wordid=source.wordid WHERE source.postid=226094 AND titlecount<10000) UNION ALL (SELECT qa_posttags.postid, 2*LOG(10000/tagcount) AS score FROM qa_posttags JOIN qa_words ON qa_posttags.wordid=qa_words.wordid JOIN qa_posttags AS source ON qa_posttags.wordid=source.wordid WHERE source.postid=226094 AND tagcount<10000) UNION ALL (SELECT qa_posts.postid, LOG(10000/qa_categories.qcount) FROM qa_posts JOIN qa_categories ON qa_posts.categoryid=qa_categories.categoryid AND qa_posts.type='Q' WHERE qa_categories.categoryid=(SELECT categoryid FROM qa_posts WHERE postid=226094) AND qa_categories.qcount<10000)) x WHERE postid!=226094 GROUP BY postid ORDER BY score DESC LIMIT

by
which version of Q2A you are using?
by
I am using 1.7.4

1 Answer

0 votes
by

Probably, it is the query of "Related Questions" plugin. Certainly this query is relatively slow. If it is the bottleneck of your site, performance will improve by disabling widget.

by
Q2A 1.8 will also have caching of this query.
by
Stott,
When are you planing to release it (1.8)?
Thanks
by
...