按每五分钟统计日志的数目
select
floor(cast(logs.timestamp as int) / 60 / 5) as dt,
count(logs.id)
from (
select
logs.id,
logs.timestamp
from public.logs as logs
order by logs.id asc
limit 10) as logs
group by floor(cast(logs.timestamp as int) / 60 / 5);