sql - Calculate no of rows created on daily basis from a huge table in mysql -
i need calculate num of rows created on daily basis huge table in mysql. i'm using
select count(1) table_name group date
the query taking more 2000sec , counting. wondering if there's optimized query or way optimize query.
if you're interested in items created on dates, calculate count @ end-of-day , store table.
that lets run count query on smaller data set (use date(now()) = date
, drop group by
)
then query new table when need data.
Comments
Post a Comment