Here is my request:
SELECT * FROM ( SELECT p.id, p.groupid, p.postid, p.date, p.likes, p.reposts, p.text, p.att1_type, p.att1_data, p.att2_type, p.att2_data, p.att3_type, p.att3_data, p.att4_type, p.att4_data, p.att5_type, p.att5_data, p.att6_type, p.att6_data, p.att7_type, p.att7_data, p.att8_type, p.att8_data, p.att9_type, p.att9_data, p.att10_type, att10_data, g.rating FROM `posts` p JOIN `verified_posts` vp ON p.`id` = vp.`pid` JOIN `grouplists` g ON p.`groupid` = g.`groupid` WHERE g.`usid` = '111' AND vp.`usid` = '111' AND g.`hide` = '0' AND g.`groupid` IN ( SELECT gid FROM gtags WHERE tid IN ('0','13') ) ORDER BY vp.`vdate` DESC LIMIT 40 ) AS tmp ORDER BY tmp.`rating` DESC I know its weak point: tid equal to 13 in the g.groupid IN (SELECT gid FROM gtags WHERE tid IN ('0','13')) part g.groupid IN (SELECT gid FROM gtags WHERE tid IN ('0','13')) - 75 additional lines and this is where the problem arises. Previously, everything worked, but recently this request began to issue in phpMyAdmin "502 Bad gateway", and php-scripts in general give out 504 error (although there is no execution limit in the php settings). In the terminal, the request works and outputs the required data.
I do not understand what to do. Maybe you faced a similar problem or know its solution?
