7 comments

[ 2.7 ms ] story [ 24.2 ms ] thread
This is pretty cool, I didn't know about window functions in Postgres. Most of the time when dealing with time series data I end up dropping into Python (pandas) or R (xts package), but it is nice to see how to do a lot of analysis right in the database.
Really interesting read. Anyone got any comparison between the performance of these against say pandas or R[1]? I'd be particularly interested if anyone has stored multiple timeseries in a table and the performance of looking for individual or the latest timeseries.

[1]: I haven't used R myself.

I don't have as much experience with pandas, but I've used window functions and psql queries in place of that sort of data munging for production web applications. We have tens of millions of rows and near real time reporting requirements.

Reach out if you want to compare notes.

Heh, some of the queries we do at work are pretty much exactly like the ones in the examples. Postgres is cool.