SELECT thread.*
,
user.*, IF(user.username IS NULL, thread.username, user.username) AS username,
node.title AS node_title, node.node_name,
post.message, post.attach_count,
NULL AS thread_read_date,
0 AS user_post_count,
permission.cache_value AS node_permission_cache,
last_post_user.avatar_date AS last_post_user_avatar_date, last_post_user.gravatar AS last_post_user_gravatar, last_post_user.gender AS last_post_user_gender, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 1) as dark_postrating_1_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 14) as dark_postrating_14_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 2) as dark_postrating_2_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 3) as dark_postrating_3_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 4) as dark_postrating_4_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 5) as dark_postrating_5_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 6) as dark_postrating_6_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 7) as dark_postrating_7_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 8) as dark_postrating_8_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 9) as dark_postrating_9_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 10) as dark_postrating_10_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 11) as dark_postrating_11_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 12) as dark_postrating_12_count, 1 as dark_postrating_has_fetched_max
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = thread.first_post_id and pr.rating = 13) as dark_postrating_13_count, 1 as dark_postrating_has_fetched_max
FROM xf_thread AS thread
LEFT JOIN xf_user AS user ON
(user.user_id = thread.user_id)
LEFT JOIN xf_node AS node ON
(node.node_id = thread.node_id)
LEFT JOIN xf_post AS post ON
(post.post_id = thread.first_post_id)
LEFT JOIN xf_permission_cache_content AS permission
ON (permission.permission_combination_id = 1
AND permission.content_type = 'node'
AND permission.content_id = thread.node_id)
LEFT JOIN xf_user AS last_post_user ON
(last_post_user.user_id = thread.last_post_user_id)
WHERE thread.thread_id IN (1568586, 1566227, 1565269, 1565266, 1564167, 1563994, 1562460, 1561214, 1552832, 1552514, 1550377, 1549081, 1549003, 1548736, 1542928, 1538240, 1536175, 1536166, 1535884, 1535287, 1533410, 1529774, 1528027, 1526514, 1524126, 1523974, 1523101, 1522302, 1516955, 1514337, 1512597, 1512006, 1510419, 1506635, 1506023, 1504958, 1504891, 1500060, 1498262, 1495534, 1495272, 1494588, 1493301, 1493029, 1493021, 1492868, 1492777, 1491812, 1488513, 1487463, 1487462, 1486427, 1485294, 1483410, 1482805, 1480653, 1478625, 1478244, 1474513, 1472983, 1472514, 1472187, 1471847, 1468674, 1465518, 1464730, 1464569, 1463950, 1457425, 1456938, 1456129, 1451504, 1449240, 1446791, 1446080, 1444027, 1443961, 1443960, 1438846, 1436749, 1435955, 1433644, 1433534, 1433260, 1432293, 1431713, 1431297, 1430965, 1429377, 1428184, 1428164, 1427617, 1423740, 1421492, 1419376, 1418978, 1417538, 1415332, 1411322, 1410059, 1403668, 1403299, 1401229, 1400813, 1399354, 1398806, 1398545, 1398144, 1397466, 1395696, 1393609, 1392919, 1388744, 1388334, 1387874, 1387092, 1385001, 1384746, 1383022, 1380941, 1377752, 1377143, 1374961, 1374010, 1373298, 1373213, 1373010, 1372151, 1370455, 1369785, 1366522, 1366208, 1365530, 1365342, 1364400, 1364268, 1362301, 1357346, 1356279, 1355812, 1353464, 1349933, 1341924, 1341297, 1340857, 1339241, 1337886, 1336489, 1335472, 1334060, 1333281, 1331409, 1328134, 1327285, 1322651, 1322497, 1322011, 1321238, 1321237, 1320285, 1320263, 1319161, 1319160, 1316889, 1316651, 1315302, 1315171, 1314878, 1312954, 1312315, 1312270, 1311922, 1311502, 1311258, 1310489, 1310191, 1310179, 1309763, 1306406, 1304799, 1304011, 1302863, 1302623, 1301385, 1300467, 1300411, 1299225, 1296745, 1294394, 1292964)
Run Time: 0.016115
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
PRIMARY | thread | range | PRIMARY | PRIMARY | 4 | | 190 | Using where |
PRIMARY | user | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.thread.user_id | 1 | |
PRIMARY | node | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.thread.node_id | 1 | |
PRIMARY | post | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.thread.first_post_id | 1 | |
PRIMARY | permission | eq_ref | PRIMARY | PRIMARY | 35 | const,const,foromtb_www.thread.node_id | 1 | Using where |
PRIMARY | last_post_user | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.thread.last_post_user_id | 1 | |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.thread.first_post_id,const | 1 | Using index |
INSERT INTO xf_tag_result_cache
(tag_id, user_id, cache_date, expiry_date, results)
VALUES
(?, ?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
cache_date = VALUES(cache_date),
expiry_date = VALUES(expiry_date),
results = VALUES(results)
Params: 81, 0, 1715148257, 1715151857, [["thread",1568586],["thread",1566227],["thread",1565269],["thread",1565266],["thread",1564167],["thread",1563994],["thread",1562460],["thread",1561214],["thread",1552832],["thread",1552514],["thread",1550377],["thread",1549081],["thread",1549003],["thread",1548736],["thread",1542928],["thread",1538240],["thread",1536175],["thread",1536166],["thread",1535884],["thread",1535287],["thread",1533410],["thread",1529774],["thread",1528027],["thread",1526514],["thread",1524126],["thread",1523974],["thread",1523101],["thread",1522302],["thread",1516955],["thread",1514337],["thread",1512597],["thread",1512006],["thread",1510419],["thread",1506635],["thread",1506023],["thread",1504958],["thread",1504891],["thread",1500060],["thread",1498262],["thread",1495534],["thread",1495272],["thread",1494588],["thread",1493301],["thread",1493029],["thread",1493021],["thread",1492868],["thread",1492777],["thread",1491812],["thread",1488513],["thread",1487463],["thread",1487462],["thread",1486427],["thread",1485294],["thread",1483410],["thread",1482805],["thread",1480653],["thread",1478625],["thread",1478244],["thread",1474513],["thread",1472983],["thread",1472514],["thread",1472187],["thread",1471847],["thread",1468674],["thread",1465518],["thread",1464730],["thread",1464569],["thread",1463950],["thread",1457425],["thread",1456938],["thread",1456129],["thread",1451504],["thread",1449240],["thread",1446791],["thread",1446080],["thread",1444027],["thread",1443961],["thread",1443960],["thread",1438846],["thread",1436749],["thread",1435955],["thread",1433644],["thread",1433534],["thread",1433260],["thread",1432293],["thread",1431713],["thread",1431297],["thread",1430965],["thread",1429377],["thread",1428184],["thread",1428164],["thread",1427617],["thread",1423740],["thread",1421492],["thread",1419376],["thread",1418978],["thread",1417538],["thread",1415332],["thread",1411322],["thread",1410059],["thread",1403668],["thread",1403299],["thread",1401229],["thread",1400813],["thread",1399354],["thread",1398806],["thread",1398545],["thread",1398144],["thread",1397466],["thread",1395696],["thread",1393609],["thread",1392919],["thread",1388744],["thread",1388334],["thread",1387874],["thread",1387092],["thread",1385001],["thread",1384746],["thread",1383022],["thread",1380941],["thread",1377752],["thread",1377143],["thread",1374961],["thread",1374010],["thread",1373298],["thread",1373213],["thread",1373010],["thread",1372151],["thread",1370455],["thread",1369785],["thread",1366522],["thread",1366208],["thread",1365530],["thread",1365342],["thread",1364400],["thread",1364268],["thread",1362301],["thread",1357346],["thread",1356279],["thread",1355812],["thread",1353464],["thread",1349933],["thread",1341924],["thread",1341297],["thread",1340857],["thread",1339241],["thread",1337886],["thread",1336489],["thread",1335472],["thread",1334060],["thread",1333281],["thread",1331409],["thread",1328134],["thread",1327285],["thread",1322651],["thread",1322497],["thread",1322011],["thread",1321238],["thread",1321237],["thread",1320285],["thread",1320263],["thread",1319161],["thread",1319160],["thread",1316889],["thread",1316651],["thread",1315302],["thread",1315171],["thread",1314878],["thread",1312954],["thread",1312315],["thread",1312270],["thread",1311922],["thread",1311502],["thread",1311258],["thread",1310489],["thread",1310191],["thread",1310179],["thread",1309763],["thread",1306406],["thread",1304799],["thread",1304011],["thread",1302863],["thread",1302623],["thread",1301385],["thread",1300467],["thread",1300411],["thread",1299225],["thread",1296745],["thread",1294394],["thread",1292964]]
Run Time: 0.006443