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,
user.*, IF(user.username IS NULL, post.username, user.username) AS username
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (1,14,2,3,4,5)) as positive_rating_count
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (7,8,9,10,11,12)) as negative_rating_count
,(select sum(count_received) from dark_postrating_count where user_id = post.user_id and rating in (13)) as neutral_rating_count
,
pr_cache.rating_cache,
pr2.rating
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
(thread.thread_id = post.thread_id)
LEFT JOIN xf_user AS user ON
(user.user_id = post.user_id)
left join dark_postrating_post_cache pr_cache ON (post.post_id = pr_cache.post_id)
left join dark_postrating pr2 on (post.post_id = pr2.post_id and pr2.user_id = 0)
WHERE post.post_id IN (48103, 72657, 17607, 26171, 31530, 11971, 54230, 59939, 40963, 64289, 43116, 13006, 39787, 67144, 71259, 28593, 47850, 12631, 32675, 15068, 42546, 28098, 43155, 51963, 60661, 66350, 41709, 45851, 70067, 38433, 41413, 41523, 49180, 6534, 44463, 56984, 10705, 41793, 61199, 58448, 44496, 48070, 64283, 65445, 51698, 37685, 30702, 52928, 59795, 19090, 57024, 32683, 74120, 53867, 60403, 25291, 52285, 56603, 66737, 41985, 70438, 9331, 44507, 4331, 48868, 46912, 57561, 5935, 59206, 17999, 57904, 28515, 43915, 1110, 24359, 50988, 12550, 32593, 44729, 58626, 71999, 42492, 41420, 45302, 54087, 66048, 74596, 65077, 9198, 42269, 55054, 55349, 10206, 29591, 24812, 58978, 69374, 72835, 13268, 71119, 39847, 47444, 63715, 18664, 31549, 64028, 64196, 14475, 36483, 70680, 27838, 32740, 55830, 49052, 63507, 81739, 38028, 57893, 82067, 35548, 54279, 64794, 69962, 34114, 63866, 38534, 56985, 62807, 29427, 70596, 34559, 74176, 55928, 37620, 45424, 43495, 13720, 58048, 68323, 31581, 50437, 52691, 64920, 50957, 64276, 58559, 73939, 42460, 48399, 34786, 46561, 53854, 67816, 37173, 78921, 16186, 30196, 45301, 61883, 33373, 45495, 64773, 68033, 77651, 41752, 54728, 24, 40189, 78042, 40234, 26922, 46211, 67067, 80099, 46247, 70449, 38601, 71966, 38649, 65427, 20679, 58681, 78786, 57269, 58697, 45047, 37537, 85317, 51751, 60622, 30518, 39764, 69750, 73044, 74503, 68025, 8018, 62183, 63710, 74677, 13773, 26192, 35751, 38310, 39917, 79521, 36048, 75120, 36080, 38597, 42282, 55142, 65211, 42332, 57138, 61763, 63067, 84611, 29727, 34896, 63191, 69044, 81166, 42796, 57348, 64597, 70823, 81265, 64684, 11354, 66062, 47386, 49882, 18191, 50007, 63785, 14083, 18690, 45908, 58413, 68358, 73530, 61238, 70389, 12068, 27358, 58558, 59839, 61501, 71688, 46368, 62926, 67429, 75970, 80340, 53525, 76007, 3090, 36892, 72220, 12965, 44930, 64374, 78791, 70776, 39670, 61862, 39715, 78967, 25288, 54155, 64722, 22073, 28288, 47307, 49790, 62059, 33580, 41703, 28434, 43860, 54740, 59735, 71502, 24333, 62766, 71507, 78052, 80047, 82784, 32214, 40291, 19145, 28991, 68829, 1809, 9426, 14526, 40726, 53475, 65375, 36768, 60017, 70637, 48717, 67781, 51490, 24858, 39657, 48873, 5411, 21032, 57821, 28260, 57863, 77401, 79059, 77634, 38185, 59337, 8551, 66623, 70044, 11628, 52688, 59709, 82211, 9030, 66812, 70147, 79971, 9137, 66979, 73720, 36391, 58465, 59801, 61329, 73755, 75309, 78167, 82803, 24389, 20285, 14765, 24618, 46477, 62965, 68885, 15017, 24731, 76075, 41237, 55809, 65769, 72355, 76243, 35000, 64443, 21800, 47032, 70860, 72894, 74358, 17588, 41544, 47150, 63533, 33486, 41594, 66136, 45609, 52366, 33585, 49995, 52443, 57968, 23189, 26454, 35980, 61099, 62340, 71272, 79920, 11794, 28532, 47721, 56904, 14177, 68574, 14277, 53008, 62805, 12279, 40581, 73873, 80291, 83609, 32662, 78633, 12652, 27723, 51429, 55599, 64344, 80968, 60273, 5157, 15631, 27936, 29795, 60335, 65841, 67861, 11018, 13054, 32986, 35309, 16515, 25125, 28143, 30297, 35423, 43475, 62022, 7643, 11413, 35508, 59319, 69937, 28358, 31026, 60754, 71244, 73178, 54446, 56693, 59542, 74708, 77760, 82141, 8749, 56864, 77792, 24106, 26608, 62342, 82580, 18926, 26634, 38467, 46085, 50912, 75149, 48049, 68743, 71543, 34339, 75675, 78502, 34450, 61548, 78546, 10123, 20446, 27601, 74013, 53726, 57253, 60223, 61794, 10332, 37044, 39302, 46610, 61805, 70701, 46760, 61817, 53947, 59083, 67877, 74212, 78955, 33129, 35393, 56354, 81282, 13538, 49392, 67956, 13670, 71227, 79357, 22092, 43785, 56633, 82114, 11564, 22243, 68075, 13950, 33973, 40080, 47706, 64899, 31835, 34234, 55002, 1345, 28705, 34245, 65189, 1395, 32586, 53137, 24452, 27477, 36598, 44575, 51099, 55268, 57118, 68840, 84154, 2551, 29519, 51139, 67702, 80759, 84545, 39088, 41175, 44841, 68991, 74068, 20824, 84729, 20841, 51561, 63286, 69273, 76289, 81241, 85113, 25051, 63430, 65886, 76364, 11350, 59189, 67928, 69563, 76444, 21841, 56572, 60675, 63695, 73174, 11500, 79434, 45776, 60972, 62293, 64876, 73292, 38423, 43876, 73523, 74861)
Run Time: 0.020439
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 | | 570 | Using where |
PRIMARY | user | eq_ref | PRIMARY | PRIMARY | 4 | sculptan_base.post.user_id | 1 | |
PRIMARY | thread | eq_ref | PRIMARY | PRIMARY | 4 | sculptan_base.post.thread_id | 1 | |
PRIMARY | pr_cache | eq_ref | PRIMARY | PRIMARY | 4 | sculptan_base.post.post_id | 1 | |
PRIMARY | pr2 | eq_ref | post_id_user_id,post_id_rating,user_id_rating | post_id_user_id | 8 | sculptan_base.post.post_id,const | 1 | |
DEPENDENT SUBQUERY | dark_postrating_count | eq_ref | user_id_rating | user_id_rating | 8 | sculptan_base.post.user_id,const | 1 | |
DEPENDENT SUBQUERY | dark_postrating_count | ref | user_id_rating | user_id_rating | 4 | sculptan_base.post.user_id | 1 | Using index condition |
DEPENDENT SUBQUERY | dark_postrating_count | ref | user_id_rating | user_id_rating | 4 | sculptan_base.post.user_id | 1 | Using index condition |