From: Johan De Meersman Date: February 24 2012 11:17am Subject: Re: USING WHERE; USING TEMPORARY; USING filesort List-Archive: http://lists.mysql.com/mysql/226850 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > From: "Daevid Vincent" > > d.`date_release`!='0000-00-00' AND sd.`scene_id`=s.`scene_id` GROUP > BY sg.`scene_id` ORDER BY num DESC, sd.`count_dl_monthly` DESC LIMIT 30; Could you put an index on sg.scene_id? Not sure, but it might help the grouping be more efficient. In general, though, you mqy be running into the limit of how big a temporary result table in memory can get before it gets moved to disk. There's two parameters that govern that iirc, max_tmp_table_size and another. Have a look at the manual. -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel