in reply to Count in intervals

10M rows in sqlite isn't that large. Have you declared indexes?