Chapter 7. Time Series Aggregates in Postgres

For the most part, every bit of your data has a timestamp. Each record (in a Rails app) probably has a timestamp for when it was created and when it was last updated. You may want to look at or analyze your data in uniform chunks of time. Maybe you want to look at hourly sales or daily rainfall, for example.

This chapter will walk you through how to split your data into uniform blocks of time, including time segments where there is no data. Armed with that information we will also draw a timeline using flight departure data from the previous chapter.

We will use this technique to answer the following question:

What does an airplane’s utilization look like?

Finding Flight Segments

The first thing ...

Get Data Visualization Toolkit: Using JavaScript, Rails™, and Postgres to Present Data and Geospatial Information now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.