SELECT SQL_NO_CACHE COUNT(*) FROM `boplusru_ads` JOIN (SELECT adv_id FROM `boplusru_adswordindex` WHERE ((dict_id = 0 AND word_id = 1) OR (dict_id = 0 AND word_id = 1318) OR (dict_id = 0 AND word_id = 436) OR (dict_id = 0 AND word_id = 14249) OR (dict_id = 0 AND word_id = 222) OR (dict_id = 0 AND word_id = 806) OR (dict_id = 0 AND word_id = 20906) OR (dict_id = 0 AND word_id = 67970)) GROUP BY adv_id ) as DW ON id = adv_id WHERE info_new = 0 AND ((city_id = 25) OR (city_id = -1)): Lost connection to MySQL server during query