Fix count implement when there is group_by, limit, join, it'll use select count(*) from (select * from table)