select
t0.id,
t1cnt,
t2cnt,
t3cnt
from t0 left join (
select id,count(*) as t1cnt
from t1 group by id
) as t11
on t0.id=t11.id
left join (
select id,count(*) as t2cnt
from t2 group by id
) as t21
on t0.id=t21.id
left join (
select id,count(*) as t3cnt
from t3 group by id
) as t31
on t0.id=t31.id
连接之后再查询不知道会不会快一点
select f0,Count(distinct f1),Count(distinct f2),Count(distinct f3)
from t0 left outer join t1 on t0.f0=t1.f1
left outer join t2 on t0.f0=t2.f2
left outer join t3 on t0.f0=t3.f3