9 Postgres for time series
This chapter covers
- Exploring Postgres capabilities for time-series workloads
- Using the TimescaleDB extension to manage and process time-series data
- Analyzing time-series data with specialized functions and aggregates
- Optimizing queries with B-tree and BRIN indexes
Time series is a series of data points collected over time, with each point representing the state of a system or object at a specific moment. By capturing time-series data over a given period, we can observe how the system has evolved or changed, which helps identify trends, take proactive actions, or make future predictions. For instance, we work with time-series data when reviewing CPU and memory usage from a server over the past week, exploring currency exchange rate fluctuations over the last three months, or analyzing a patient's vital signs collected over the past year.
In this chapter, you learn to use Postgres for time-series data and workloads. You start by exploring the nature of time-series data and the capabilities Postgres offers for working with it. Next, you dive into the TimescaleDB extension, which makes it easy to store, analyze, and manage time-series data in Postgres. Finally, you learn how to optimize the search over time-series data with B-tree and BRIN indexes. And you do all this the developer way while working on an application for smartwatches that tracks a user’s heart rate and provides important health data.