CREATE INDEX if not exists idx_stats_day ON stats(insertedAt / (3600*24));