Node.js / Postgres time-series analytics