SELECT dfid,count(*)
from downloads_downloads
WHERE dmid IN (
SELECT dmid
FROM downloads_downloads
where dfid = "7024"
)
group by dfid
o usando una unión automática
select t1.dfid,count(*)
from downloads_downloads t1
inner join downloads_downloads t2
on t1.dmid = t2.dmid
where t2.dfid = "7024"
si esto lleva demasiado tiempo, probablemente necesitará publicar un plan explicativo (¡búsquelo en Google!)