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

I activated QA_DEBUG_PERFORMANCE and getting this data:

 

Total – 2213.9ms (100%) – PHP 1547.8ms (69%), MySQL 613.9ms (27%), Other 52.2ms (2%) – 57 PHP files, 34 DB queries, 26267k RAM (100%)

Setup – 1406.6ms (63%) – PHP 1215.8ms (54%), MySQL 133.5ms (6%), Other 57.3ms (2%) – 31 PHP files, 1 DB query, 21784k RAM (82%) 
Control – 105.1ms (4%) – PHP 40.0ms (1%), MySQL 65.8ms (2%), Other 0.0ms (0%) – 6 PHP files, 1 DB query, 1249k RAM (4%) 
View – 166.9ms (7%) – PHP 167.0ms (7%), MySQL 0.0ms (0%), Other 0.0ms (0%) – 8 PHP files, 0 DB queries, 809k RAM (3%) 
Theme – 535.1ms (24%) – PHP 124.0ms (5%), MySQL 414.6ms (18%), Other 0.0ms (0%) – 12 PHP files, 32 DB queries, 2422k RAM (9%)

 

 

Q2A version: 1.7
by
(SELECT 'options' AS selectkey, title, content FROM qa_options) UNION ALL (SELECT 'time', 'db_time', UNIX_TIMESTAMP(NOW()))

783.19 ms - 95074 rows - 3 columns

(SELECT '0' AS selectkey, 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_uservotes.vote AS uservote, qa_uservotes.flag AS userflag, qa_userfavorites.entityid<=>qa_posts.postid AS userfavoriteq, 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, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oname, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oflags, NULL AS olevel, NULL AS oemail, NULL AS ohandle, NULL AS oavatarblobid, NULL AS oavatarwidth, NULL AS oavatarheight, NULL AS opoints, NULL AS oupdatetype, NULL AS oupdated, NULL AS parentid, NULL AS qcount, NULL AS position, NULL AS childcount, NULL AS content, NULL AS backpath, NULL AS passsalt, NULL AS passcheck, NULL AS emailcode, NULL AS sessioncode, NULL AS sessionsource, NULL AS loggedin, NULL AS loginip, NULL AS written, NULL AS writeip, NULL AS wallposts, NULL AS noticeid, NULL AS format, NULL AS action, NULL AS period, NULL AS count, NULL AS entityid, NULL AS entitytype, NULL AS pageid, NULL AS permit, NULL AS nav, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' 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 FROM qa_posts WHERE type='Q' ORDER BY qa_posts.created DESC LIMIT 0,20) y ON qa_posts.postid=y.postid) UNION ALL (SELECT '1', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag, qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, aposts.name, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, ausers.flags, ausers.level, ausers.email, ausers.handle, BINARY ausers.avatarblobid, ausers.avatarwidth, ausers.avatarheight, auserpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid LEFT JOIN qa_users AS ausers ON aposts.userid=ausers.userid LEFT JOIN qa_userpoints AS auserpoints ON aposts.userid=auserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type='A' ORDER BY qa_posts.created DESC LIMIT 0,50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '2', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag,
by
qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, cposts.name, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, cusers.flags, cusers.level, cusers.email, cusers.handle, BINARY cusers.avatarblobid, cusers.avatarwidth, cusers.avatarheight, cuserpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE LEFT(parentposts.type, 1) WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid LEFT JOIN qa_users AS cusers ON cposts.userid=cusers.userid LEFT JOIN qa_userpoints AS cuserpoints ON cposts.userid=cuserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type='C' ORDER BY qa_posts.created DESC LIMIT 0,50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND ((parentposts.type='Q') OR (parentposts.type='A'))) UNION ALL (SELECT '3', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag, qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, editposts.name, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editusers.flags, editusers.level, editusers.email, editusers.handle, BINARY editusers.avatarblobid, editusers.avatarwidth, editusers.avatarheight, edituserpoints.points, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) LEFT JOIN qa_users AS editusers ON editposts.lastuserid=editusers.userid LEFT JOIN qa_userpoints AS edituserpoints ON editposts.lastuserid=edituserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type IN ('Q', 'A', 'C') ORDER BY qa_posts.updated DESC LIMIT 0,50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT '4', NULL, qa_categories.categoryid, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_categories.title, qa_categories.tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_categories.parentid, qa_categories.qcount, qa_categories.position, COUNT(child.categoryid), qa_categories.content, qa_categories.backpath, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_categories JOIN (SELECT NULL AS parentkey UNION SELECT grandparent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid JOIN qa_categories AS grandparent ON parent.parentid=grandparent.categoryid WHERE qa_categories.backpath='' UNION SELECT parent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid WHERE qa_categories.backpath='' UNION SELECT parentid FROM qa_categories WHERE backpath='' UNION SELECT categoryid FROM qa_categories WHERE backpath='') y ON qa_categories.parentid<=>parentkey LEFT JOIN qa_categories AS child ON child.parentid=qa_categories.categoryid GROUP BY qa_categories.categoryid ORDER BY qa_categories.position) UNION ALL (SELECT 'pending_loggedinuser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_users.userid, NULL, NULL, points, flags, level, email, handle, BINARY avatarblobid, avatarwidth, avatarheight, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, passsalt, HEX(passcheck), emailcode, sessioncode, sessionsource, UNIX_TIMESTAMP(loggedin), INET_NTOA(loginip), UNIX_TIMESTAMP(written), INET_NTOA(writeip), wallposts, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_users LEFT JOIN qa_userpoints ON qa_userpoints.userid=qa_users.userid WHERE qa_users.userid='3') UNION ALL (SELECT 'pending_notices', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tags, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
by
NULL, NULL, NULL, content, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, noticeid, format, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_usernotices WHERE userid='3' ORDER BY created) UNION ALL (SELECT 'pending_favoritenonqs', NULL, NULL, entitytype, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_words.word, NULL, NULL, NULL, qa_categories.backpath, NULL, NULL, NULL, NULL, IF (entitytype='U', entityid, NULL), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userfavorites LEFT JOIN qa_words ON entitytype='T' AND wordid=entityid LEFT JOIN qa_categories ON entitytype='C' AND categoryid=entityid WHERE userid='3' AND entitytype!='Q') UNION ALL (SELECT 'pending_userlimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlimits WHERE userid='3') UNION ALL (SELECT 'pending_userlevels', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, level, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, entityid, entitytype, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlevels WHERE userid='3') UNION ALL (SELECT 'pending_iplimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_iplimits WHERE ip=COALESCE(INET_ATON('186.251.86.149'), 0)) UNION ALL (SELECT 'pending_navpages', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, permit+0, nav, heading, NULL, NULL FROM qa_pages WHERE nav IN ('B','M','O','F') ORDER BY position) UNION ALL (SELECT 'pending_widgets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, widgetid, place FROM qa_widgets ORDER BY position)

917.47 ms - 728 rows - 84 columns

SELECT UNIX_TIMESTAMP(meta_value) FROM qa_usermeta WHERE user_id=3 AND meta_key='visited_profile'

5.53 ms - 1 row - 1 column
by
SELECT COUNT(event) FROM qa_eventlog
                                WHERE FROM_UNIXTIME(1455146530) <= datetime
                                AND DATE_SUB(CURDATE(),INTERVAL 365 DAY) <= datetime
                                AND (
                                (userid=3 AND event LIKE "in_%")
                                OR ((event LIKE "u_message" OR event LIKE "u_wall_post") AND params LIKE "userid=3\t%")
                                )
                                

13.97 ms - 1 row - 1 column

SELECT * FROM qa_widgetanyw ORDER BY ordering

0.60 ms - 8 rows - 6 columns

SELECT postid, handle, vote, flag FROM qa_uservotes LEFT JOIN qa_users ON qa_uservotes.userid=qa_users.userid WHERE postid IN (725292,725299,724796,725298,725289,725297,721084,721128,725296,725295,725287,725294,725217,725291,724797,725290,725056,725288,725248,725286,725036,725285,725247,725284,725274,725283,708180,725282,723991,724963,708473,725280,725211,725278,725034,725277,725188) AND ((vote!=0) OR (flag!=0))

3017.47 ms - 60 rows - 4 columns

SELECT qa_users.userid, handle, points, flags, qa_users.email, BINARY avatarblobid AS avatarblobid, avatarwidth, avatarheight FROM qa_users JOIN qa_userpoints ON qa_users.userid=qa_userpoints.userid JOIN qa_userfavorites ON qa_users.userid=qa_userfavorites.entityid WHERE qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='U' ORDER BY qa_users.handle

6.69 ms - 512 rows - 8 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='O MENSAGEIRO' LIMIT 1)

3.49 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Enis Junior' LIMIT 1)

3.22 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Forasteiro' LIMIT 1)

2.12 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='patolino troll' LIMIT 1)

3.34 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='H€ΔV€N' LIMIT 1)

3.23 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Ludo Final' LIMIT 1)

3.86 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Bárbara.' LIMIT 1)

4.09 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Marcus' LIMIT 1)

3.34 ms - 1 row - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Sir Jimmy Page' LIMIT 1)

1.18 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='ManoW ☯' LIMIT 1)

0.25 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Branco' LIMIT 1)

0.39 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='°Sђล∂๏ખ° †' LIMIT 1)

0.30 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='O REI DO RIO' LIMIT 1)

3.74 ms - 6 rows - 2 columns

SELECT qa_users.userid, handle, points, flags, qa_users.email, avatarblobid, avatarwidth, avatarheight FROM qa_users JOIN qa_userpoints ON qa_users.userid=qa_userpoints.userid JOIN qa_userfavorites ON qa_users.userid=qa_userfavorites.userid WHERE qa_userfavorites.entityid='3' AND qa_userfavorites.entitytype='U'

41.70 ms - 256 rows - 8 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Kenny Mccormick' LIMIT 1)

3.73 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Stanley Marsh' LIMIT 1)

3.16 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Robert▧Likes▧Plants' LIMIT 1)

3.36 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='LUK' LIMIT 1)

3.23 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='OFF LINE' LIMIT 1)

4.01 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Lost' LIMIT 1)

4.19 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Lucius Malfoy II' LIMIT 1)

37.76 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Antigσ Usuário' LIMIT 1)

0.40 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='● RαƒαєІ Øliνєiяα  ●' LIMIT 1)

0.31 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='ᗩⅤᗩƬᗩᖇ ᗯᗩᘉ' LIMIT 1)

0.21 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Fabio SCCP' LIMIT 1)

0.27 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='SrtaJujuba' LIMIT 1)

0.19 ms - 6 rows - 2 columns

SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Tati Paulla' LIMIT 1)

0.22 ms - 6 rows - 2 columns
by
I made a new test.
I hope someone can help me.
Results:
by
+1
SELECT 'options' AS selectkey, title, content FROM qa_options) UNION ALL (SELECT 'time', 'db_time', UNIX_TIMESTAMP(NOW()))

127.05 ms - 95074 rows - 3 columns

(SELECT '0' AS selectkey, 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_uservotes.vote AS uservote, qa_uservotes.flag AS userflag, qa_userfavorites.entityid<=>qa_posts.postid AS userfavoriteq, 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, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oname, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oflags, NULL AS olevel, NULL AS oemail, NULL AS ohandle, NULL AS oavatarblobid, NULL AS oavatarwidth, NULL AS oavatarheight, NULL AS opoints, NULL AS oupdatetype, NULL AS oupdated, NULL AS parentid, NULL AS qcount, NULL AS position, NULL AS childcount, NULL AS content, NULL AS backpath, NULL AS passsalt, NULL AS passcheck, NULL AS emailcode, NULL AS sessioncode, NULL AS sessionsource, NULL AS loggedin, NULL AS loginip, NULL AS written, NULL AS writeip, NULL AS wallposts, NULL AS noticeid, NULL AS format, NULL AS action, NULL AS period, NULL AS count, NULL AS entityid, NULL AS entitytype, NULL AS pageid, NULL AS permit, NULL AS nav, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' 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 FROM qa_posts WHERE type='Q' ORDER BY qa_posts.created DESC LIMIT 0,20) y ON qa_posts.postid=y.postid) UNION ALL (SELECT '1', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag, qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, aposts.name, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, ausers.flags, ausers.level, ausers.email, ausers.handle, BINARY ausers.avatarblobid, ausers.avatarwidth, ausers.avatarheight, auserpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON
by
qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid LEFT JOIN qa_users AS ausers ON aposts.userid=ausers.userid LEFT JOIN qa_userpoints AS auserpoints ON aposts.userid=auserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type='A' ORDER BY qa_posts.created DESC LIMIT 0,50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '2', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag, qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, cposts.name, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, cusers.flags, cusers.level, cusers.email, cusers.handle, BINARY cusers.avatarblobid, cusers.avatarwidth, cusers.avatarheight, cuserpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE LEFT(parentposts.type, 1) WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid LEFT JOIN qa_users AS cusers ON cposts.userid=cusers.userid LEFT JOIN qa_userpoints AS cuserpoints ON cposts.userid=cuserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type='C' ORDER BY qa_posts.created DESC LIMIT 0,50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND ((parentposts.type='Q') OR (parentposts.type='A'))) UNION ALL (SELECT '3', qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_posts.name, qa_categories.title, qa_categories.backpath, CONCAT_WS(',', qa_posts.catidpath1, qa_posts.catidpath2, qa_posts.catidpath3, qa_posts.categoryid), qa_uservotes.vote, qa_uservotes.flag, qa_userfavorites.entityid<=>qa_posts.postid, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email, qa_users.handle, BINARY qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, editposts.name, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editusers.flags, editusers.level, editusers.email, editusers.handle, BINARY editusers.avatarblobid, editusers.avatarwidth, editusers.avatarheight, edituserpoints.points, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON
by
qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_uservotes ON qa_posts.postid=qa_uservotes.postid AND qa_uservotes.userid='3' LEFT JOIN qa_userfavorites ON qa_posts.postid=qa_userfavorites.entityid AND qa_userfavorites.userid='3' AND qa_userfavorites.entitytype='Q' LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) LEFT JOIN qa_users AS editusers ON editposts.lastuserid=editusers.userid LEFT JOIN qa_userpoints AS edituserpoints ON editposts.lastuserid=edituserpoints.userid JOIN (SELECT postid FROM qa_posts WHERE type IN ('Q', 'A', 'C') ORDER BY qa_posts.updated DESC LIMIT 0,50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT '4', NULL, qa_categories.categoryid, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_categories.title, qa_categories.tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_categories.parentid, qa_categories.qcount, qa_categories.position, COUNT(child.categoryid), qa_categories.content, qa_categories.backpath, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_categories JOIN (SELECT NULL AS parentkey UNION SELECT grandparent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid JOIN qa_categories AS grandparent ON parent.parentid=grandparent.categoryid WHERE qa_categories.backpath='' UNION SELECT parent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid WHERE qa_categories.backpath='' UNION SELECT parentid FROM qa_categories WHERE backpath='' UNION SELECT categoryid FROM qa_categories WHERE backpath='') y ON qa_categories.parentid<=>parentkey LEFT JOIN qa_categories AS child ON child.parentid=qa_categories.categoryid GROUP BY qa_categories.categoryid ORDER BY qa_categories.position) UNION ALL (SELECT 'pending_loggedinuser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_users.userid, NULL, NULL, points, flags, level, email, handle, BINARY avatarblobid, avatarwidth, avatarheight, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, passsalt, HEX(passcheck), emailcode, sessioncode, sessionsource, UNIX_TIMESTAMP(loggedin), INET_NTOA(loginip), UNIX_TIMESTAMP(written), INET_NTOA(writeip), wallposts, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_users LEFT JOIN qa_userpoints ON qa_userpoints.userid=qa_users.userid WHERE qa_users.userid='3') UNION ALL (SELECT 'pending_notices', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tags, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, content, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, noticeid, format, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_usernotices WHERE userid='3' ORDER BY created) UNION ALL (SELECT 'pending_favoritenonqs', NULL, NULL, entitytype, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_words.word, NULL, NULL, NULL, qa_categories.backpath, NULL, NULL, NULL, NULL, IF (entitytype='U', entityid, NULL), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userfavorites LEFT JOIN qa_words ON entitytype='T' AND wordid=entityid LEFT JOIN qa_categories ON entitytype='C' AND categoryid=entityid WHERE userid='3' AND entitytype!='Q') UNION ALL (SELECT 'pending_userlimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlimits WHERE userid='3') UNION ALL (SELECT 'pending_userlevels', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, level, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, entityid, entitytype, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlevels WHERE userid='3') UNION ALL (SELECT 'pending_iplimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_iplimits WHERE ip=COALESCE(INET_ATON('186.251.86.149'), 0)) UNION ALL (SELECT 'pending_navpages', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, permit+0, nav, heading, NULL, NULL FROM qa_pages WHERE nav IN ('B','M','O','F') ORDER BY position) UNION ALL (SELECT 'pending_widgets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, widgetid, place FROM qa_widgets ORDER BY position)

196.52 ms - 714 rows - 84 columns
by
Are these queries all from the same page? Or many different pages?

BTW it would be easier to put all this into a text file rather than posting so many comments. You can use pastebin.com for that.
by
Are two different pages.
You can find out what is wrong, Scott?

1 Answer

+1 vote
by
selected by
 
Best answer

Here are some of the things I notice about what you've posted:

1. Many of the slow queries you posted (like the first qa_options one) are standard queries that normally run fast. They are probably only running slow because of the high load.

2. The vast majority of the load time looks to be in the Setup. The 2 main things that are loaded in Setup are login modules and any process modules that handle "init_page". So take a look for any plugins using those, they could be the culprit.

3. You have a ton of queries like
    SELECT title, content FROM qa_userprofile WHERE userid=(SELECT userid FROM qa_users WHERE handle='Enis Junior' LIMIT 1)
That looks like a plugin is running multiple queries in a loop. That query comes from the Q2A function qa_db_user_profile_selectspec, but that is not used in a loop within Q2A at all. See if you can find which plugin is doing that.

4. Also as I suggested previously, you should find that using the option QA_OPTIMIZE_LOCAL_DB in qa-config.php will increase performance for you.

by
Hi Scott. Thanks. 4 plugins use qa_db_user_profile_selectspec:
Question Followers widget
Follow Users
My Followes Widget
Category Followes Widget

None plugin has qa_register_plugin_module('process' in qa-plugin.php
by
Hmm, looks like those plugins are not available any more, so I can't really suggest any improvements, sorry.
by
Thanks, Scott. You helped a lot.
by
I delete from my server 4 plugins and the problem continues to happen.
...