Timescale Cloud: Performance, Scale, Enterprise
Self-hosted products
MST
Time-series data represents the way a system, process, or behavior changes over time. Hypertables enable TimescaleDB to work efficiently with time-series data. Hypertables are PostgreSQL tables that automatically partition your time-series data by time. Each hypertable is made up of child tables called chunks. Each chunk is assigned a range of time, and only contains data from that range. When you run a query, TimescaleDB identifies the correct chunk and runs the query on it, instead of going through the entire table.
Hypercore is the Timescale hybrid row-columnar storage engine used by hypertables. Traditional databases force a trade-off between fast inserts (row-based storage) and efficient analytics (columnar storage). Hypercore eliminates this trade-off, allowing real-time analytics without sacrificing transactional capabilities.
Hypercore dynamically stores data in the most efficient format for its lifecycle:
- Row-based storage for recent data: the most recent chunk (and possibly more) is always stored in the rowstore, ensuring fast inserts, updates, and low-latency single record queries. Additionally, row-based storage is used as a writethrough for inserts and updates to columnar storage.
- Columnar storage for analytical performance: chunks are automatically compressed into the columnstore, optimizing storage efficiency and accelerating analytical queries.
Unlike traditional columnar databases, hypercore allows data to be inserted or modified at any stage, making it a flexible solution for both high-ingest transactional workloads and real-time analytics—within a single database.
Because TimescaleDB is 100% PostgreSQL, you can use all the standard PostgreSQL tables, indexes, stored procedures, and other objects alongside your hypertables. This makes creating and working with hypertables similar to standard PostgreSQL.

Each hypertable is partitioned into child hypertables called chunks. Each chunk is assigned a range of time, and only contains data from that range. If the hypertable is also partitioned by space, each chunk is also assigned a subset of the space values.
When TimescaleDB creates a chunk, the creation time is stored in the catalog metadata. This chunk creation time is not the same as the partition ranges for the data contained in the chunk. Certain functionality can use this chunk creation time metadata in cases where it makes sense.
Note
Inheritance is not supported for hypertables and may lead to unexpected behavior.
Each hypertable chunk holds data for a specific time range only. When you insert data from a time range that doesn't yet have a chunk, TimescaleDB automatically creates a chunk to store it.
By default, each chunk covers 7 days. You can change this to better suit your
needs. For example, if you set chunk_interval
to 1 day, each chunk stores
data from the same day. Data from different days is stored in different chunks.
The following figure shows the difference in structure between a relational table and a hypertable:

TimescaleDB divides time into potential chunk ranges, based on the
chunk_interval
. If data exists for a potential chunk range, that chunk is
created.
In practice, this means that the start time of your earliest chunk does not necessarily equal the earliest timestamp in your hypertable. Instead, there might be a time gap between the start time and the earliest timestamp. This doesn't affect your usual interactions with your hypertable, but might affect the number of chunks you see when inspecting it.
Chunk size affects insert and query performance. You want a chunk small enough to fit into memory so you can insert and query recent data without reading from disk. However, having too many small and sparsely filled chunks can affect query planning time and compression.
Best practice is to set chunk_interval
so that prior to processing, one chunk of data
takes up 25% of main memory, including the indexes from each active hypertable.
For example, if you write approximately 2 GB of data per day to a database with 64 GB of
memory, set chunk_interval
to 1 week. If you write approximately 10 GB of data per day
on the same machine, set the time interval to 1 day.
For a detailed analysis of how to optimize your chunk sizes, see the
blog post on chunk time intervals. To learn how
to view and set your chunk time intervals, see how to
Optimize hypertable chunk intervals.
By default, indexes are automatically created when you create a hypertable.
The default indexes are:
- On all hypertables, an index on time, descending
- On hypertables with space partitions, an index on the space parameter and time
hypertables have some restrictions on unique constraints and indexes. If you want a unique index on a hypertable, it must include all the partitioning columns for the table. To learn more, see Enforce constraints with unique indexes on hypertables.
You can prevent index creation by setting the create_default_indexes
option to false
.
This section shows you how to:
Keywords
Found an issue on this page?Report an issue or Edit this page
in GitHub.