liveBook · Manning

Hypertable

As explained in Just Use Postgres!

A hypertable is a TimescaleDB-managed table that automatically organizes time-series rows into partitions called chunks.

A hypertable is a regular PostgreSQL table that TimescaleDB automatically partitions and manages for time-series data. Its partitions are called chunks, and each chunk is a regular PostgreSQL child table. section 9.4

SELECT create_hypertable(
  relation => 'watch.heart_rate_measurements',
  dimension => by_range('recorded_at', interval '1 month'),
  create_default_indexes => false
);

Convert the heart-rate table into a hypertable partitioned by monthly ranges of recorded_at, while leaving default index creation disabled. section 9.4

The dimension defines the partitioning method and time column. Monthly ranges suit the small smartwatch dataset, but larger deployments may need daily, hourly, or device-based partitions to avoid oversized chunks. section 9.4

Inspecting and extending chunks

Use show_chunks('watch.heart_rate_measurements') to list managed partitions. Inserting a reading at 2025-12-08 00:25 creates a new chunk covering 2025-12-08 through 2026-01-07. An EXPLAIN query restricted to that time range scans only the new chunk. section 9.4

Hypertables also store continuous-aggregate results in partitioned hypertables, allowing precomputed time buckets to be queried like regular tables. section 9.6.1

How Just Use Postgres! covers it

How deep it goes
Explains creation, range dimensions, chunk inspection, insertion behavior, query scanning, and partition-sizing caveats.
Examples
Uses smartwatch heart-rate measurements, monthly chunks, show_chunks output, EXPLAIN plans, and a five-minute continuous aggregate.
What it assumes
Assumes familiarity with PostgreSQL tables and SQL while teaching partition dimensions, chunks, and hypertable management.
What you can do after
Operate/configure hypertables with create_hypertable, inspect chunks, and verify time-based query behavior with EXPLAIN.
How it connects
Connects hypertables with TimescaleDB, PostgreSQL partitions, chunks, continuous aggregates, materialized views, and time buckets.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.