SELECT
post.*
,
thread.*, thread.user_id AS thread_user_id, thread.username AS thread_username,
thread.post_date AS thread_post_date,
post.user_id, post.username, post.post_date,
node.title AS node_title, node.node_name,
user.*, IF(user.username IS NULL, post.username, user.username) AS username,
permission.cache_value AS node_permission_cache, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 1) as dark_postrating_1_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 14) as dark_postrating_14_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 2) as dark_postrating_2_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 3) as dark_postrating_3_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 4) as dark_postrating_4_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 5) as dark_postrating_5_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 6) as dark_postrating_6_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 7) as dark_postrating_7_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 8) as dark_postrating_8_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 9) as dark_postrating_9_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 10) as dark_postrating_10_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 11) as dark_postrating_11_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 12) as dark_postrating_12_count
, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 13) as dark_postrating_13_count
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (1,2,4,5,7,8,10)) as positive_rating_count
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (14,11,12,13)) as negative_rating_count
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (3,6,9)) as neutral_rating_count
,
pr2.rating, rating.fb_percent, rating.fb_positive, rating.fb_positivetotal, rating.fb_negative, rating.fb_neutral,
permission_combination.cache_value AS global_permission_cache
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
(thread.thread_id = post.thread_id)
INNER JOIN xf_node AS node ON
(node.node_id = thread.node_id)
LEFT JOIN xf_user AS user ON
(user.user_id = post.user_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 dark_postrating pr2 ON (post.post_id = pr2.post_id and pr2.user_id = 0)
LEFT JOIN xc_trade_user AS rating ON rating.user_id=post.user_id
LEFT JOIN xf_permission_combination AS permission_combination ON
(permission_combination.permission_combination_id = user.permission_combination_id)
WHERE post.post_id IN (28485691, 28304443, 28304417, 28301447, 28288366, 28283456, 28283029, 28282902, 28282199, 28280611, 28271312, 28212678, 28212128, 28205695, 28201185, 28158759, 28112179, 28112140, 28102062, 28101562, 28101554, 28016499, 28016486, 28015714, 27899151, 27897129, 27888863, 27868400, 27854253, 27844560, 27841813, 27839662, 27825257, 27821765, 27821264, 27820574, 27818710, 27818282, 27815814, 27815795, 27815784, 27814454, 27803221, 27783722, 27782058, 27781750, 27781722, 27778575, 27778528, 27770562, 27770553, 27767634, 27765983, 27751889, 27750762, 27739204, 27739183, 27739054, 27739047, 27733121, 27731718, 27731544, 27731505, 27731502, 27728966, 27727160, 27726874, 27725919, 27725017, 27723342, 27723289, 27721650, 27721648, 27718895, 27718863, 27716309, 27715478, 27707790, 27707747, 27698572, 27698024, 27697289, 27695855, 27553597, 27552979, 27548577, 27546522, 27546485, 27533345, 27529415, 27525724, 27524954, 27523745, 27522644, 27521805, 27521326, 27493168, 27493096, 27446047, 27440440, 27440381, 27439908, 27439903, 27430296, 27351726, 27351717, 27333549, 27287939, 27287932, 27261149, 27257336, 27257332, 27251899, 27245837, 27245835, 27205641, 27180844, 26961916, 24858398, 24599526, 23982396, 23981458, 22036875, 22025220)
Run Time: 0.012608
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
PRIMARY | post | range | PRIMARY,thread_id_post_date,thread_id_position | PRIMARY | 4 | | 124 | Using where |
PRIMARY | user | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.post.user_id | 1 | |
PRIMARY | thread | eq_ref | PRIMARY,node_id_last_post_date,node_id_sticky_state_last_post | PRIMARY | 4 | foromtb_www.post.thread_id | 1 | |
PRIMARY | node | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.thread.node_id | 1 | |
PRIMARY | permission | eq_ref | PRIMARY | PRIMARY | 35 | const,const,foromtb_www.thread.node_id | 1 | Using where |
PRIMARY | pr2 | eq_ref | post_id_user_id,post_id_rating,user_id_rating | post_id_user_id | 8 | foromtb_www.post.post_id,const | 1 | |
PRIMARY | rating | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.post.user_id | 1 | |
PRIMARY | permission_combination | eq_ref | PRIMARY | PRIMARY | 4 | foromtb_www.user.permission_combination_id | 1 | Using where |
DEPENDENT SUBQUERY | dark_postrating_count | ref | user_id_rating | user_id_rating | 4 | foromtb_www.post.user_id | 1 | Using index condition |
DEPENDENT SUBQUERY | dark_postrating_count | ref | user_id_rating | user_id_rating | 4 | foromtb_www.post.user_id | 1 | Using index condition |
DEPENDENT SUBQUERY | dark_postrating_count | ref | user_id_rating | user_id_rating | 4 | foromtb_www.post.user_id | 1 | Using index condition |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
DEPENDENT SUBQUERY | pr | ref | post_id_rating | post_id_rating | 8 | foromtb_www.post.post_id,const | 1 | Using index |
INSERT INTO `xf_search` (`search_results`, `result_count`, `search_type`, `search_query`, `search_constraints`, `search_order`, `search_grouping`, `user_results`, `warnings`, `user_id`, `search_date`, `query_hash`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Params: [["post",28485691],["post",28304443],["post",28304417],["post",28301447],["post",28288366],["post",28283456],["post",28283029],["post",28282902],["post",28282199],["thread",1555361],["post",28271312],["post",28212678],["thread",1552608],["post",28205695],["thread",1552146],["post",28158759],["post",28112179],["post",28112140],["post",28102062],["post",28101562],["post",28101554],["post",28016499],["post",28016486],["post",28015714],["post",27899151],["post",27897129],["post",27888863],["post",27868400],["post",27854253],["post",27844560],["post",27841813],["post",27839662],["post",27825257],["post",27821765],["post",27821264],["post",27820574],["thread",1535642],["post",27818282],["post",27815814],["post",27815795],["post",27815784],["post",27814454],["post",27803221],["post",27783722],["post",27782058],["post",27781750],["post",27781722],["post",27778575],["post",27778528],["post",27770562],["post",27770553],["post",27767634],["post",27765983],["post",27751889],["post",27750762],["post",27739204],["post",27739183],["post",27739054],["post",27739047],["post",27733121],["post",27731718],["post",27731544],["post",27731505],["post",27731502],["post",27728966],["post",27727160],["post",27726874],["post",27725919],["post",27725017],["post",27723342],["post",27723289],["post",27721650],["post",27721648],["post",27718895],["post",27718863],["post",27716309],["post",27715478],["post",27707790],["post",27707747],["post",27698572],["post",27698024],["post",27697289],["post",27695855],["post",27553597],["post",27552979],["post",27548577],["post",27546522],["post",27546485],["post",27533345],["post",27529415],["post",27525724],["post",27524954],["post",27523745],["post",27522644],["post",27521805],["post",27521326],["post",27493168],["post",27493096],["post",27446047],["post",27440440],["post",27440381],["post",27439908],["post",27439903],["post",27430296],["post",27351726],["post",27351717],["post",27333549],["post",27287939],["post",27287932],["post",27261149],["post",27257336],["post",27257332],["post",27251899],["post",27245837],["post",27245835],["post",27205641],["post",27180844],["post",26961916],["post",24858398],["post",24599526],["post",23982396],["post",23981458],["post",22036875],["post",22025220]], 124, user, , {"user_id":314850,"content":false}, date, 0, , [], 0, 1714811873, b262218db552526764228b106b9e8003
Run Time: 0.011192