TimescaleDb is a free, open source databases project written in C and released under a custom open-source licence. It has 23,540 GitHub stars, 1,150 forks and 389 open issues, and was last pushed 8 hours ago. On this registry it ranks #25 of 81 tracked projects in Databases, with 5 head-to-head comparisons available. It gained 24 stars over the last 6 tracked days.

TimescaleDb — Time-series database built on top of PostgreSQL

What is TimescaleDb?

What it is

TimescaleDB is a time-series database built on top of PostgreSQL and packaged as a PostgreSQL extension. It lives in the PostgreSQL ecosystem, and it uses SQL and PostgreSQL clients such as psql and pgAdmin. The project targets high-performance real-time analytics on time-series and event data, with repository topics for IoT, financial-analysis, and historian workloads.

The concrete problem it addresses is storing and querying large volumes of timestamped events inside the PostgreSQL environment. It provides hypertables, a columnstore, and analytical query support through PostgreSQL-compatible SQL. The README shows a table for IoT sensor data with time, sensor_id, temperature, humidity, and pressure, which illustrates the type of event data it is designed to handle.

Key capabilities

  • It provides a PostgreSQL extension named timescaledb, which can be verified through pg_extension with extname and extversion.
  • It creates hypertables by adding the WITH (tsdb.hypertable) table option, as shown for sensor_data.
  • It supports a columnstore for time-series data, including inserting data into the columnstore and enabling compression through documented columnstore and manual-compression features.
  • It exposes analytical query workflows through SQL and PostgreSQL clients, including psql on port 6543 and pgAdmin with host localhost, port 6543, user postgres, and password password.
  • It can be started with a one-line shell script or a Docker command that maps container port 5432 to host port 6543.

Who uses it and how

  • Developers can run a local TimescaleDB instance with the one-line install script or Docker, then connect with psql to create a hypertable for sensor readings.
  • Users can use pgAdmin as a graphical PostgreSQL client against the same local service, using the documented host, port, user, and password.
  • Teams working with IoT sensor data can model tables with timestamp, sensor identifier, and measurement columns, then query analytical results from the hypertable.
  • Repository topics indicate intended use for analytics, financial-analysis, historian, IoT, and time-series database workloads, while the README excerpt shows concrete examples only for sensor data.

Getting started

The README recommends a one-line install for local development and testing, or a Docker command using timescale/timescaledb-ha:pg18, and it directs users to the TimescaleDB installation guide for production-ready options. A hosted Tiger Cloud trial is also referenced.

When to use it — and when not to

Use TimescaleDB when the workload is time-series or event analytics inside a PostgreSQL environment, and when the operator is prepared to manage the database, persistent storage, ports, and credentials. The one-line install is explicitly for local development and testing only, so production use requires the documented installation guide and a supported deployment path. The license is listed as NOASSERTION, so teams that require a clearly stated open-source license should review the project’s licensing terms before adoption.

project readme (upstream, from github) — read inline

TimescaleDB is a PostgreSQL extension for high-performance real-time analytics on time-series and event data

Docs SLACK Try TimescaleDB for free

Quick Start with TimescaleDB

Get started with TimescaleDB in under 10 minutes. This guide will help you run TimescaleDB locally, create your first hypertable with columnstore enabled, write data to the columnstore, and see instant analytical query performance.

What You'll Learn

  • How to run TimescaleDB with a one-line install or Docker command
  • How to create a hypertable with columnstore enabled
  • How to insert data directly to the columnstore
  • How to execute analytical queries

Prerequisites

  • Docker installed on your machine
  • 8GB RAM recommended
  • psql client (included with PostgreSQL) or any PostgreSQL client like pgAdmin

Step 1: Start TimescaleDB

You have two options to start TimescaleDB:

Option 1: One-line install (Recommended)

The easiest way to get started:

Important: This script is intended for local development and testing only. Do not use it for production deployments. For production-ready installation options, see the TimescaleDB installation guide.

Linux/Mac:

curl -sL https://tsdb.co/start-local | sh

This command:

  • Downloads and starts TimescaleDB (if not already downloaded)
  • Exposes PostgreSQL on port 6543 (a non-standard port to avoid conflicts with other PostgreSQL instances on port 5432)
  • Automatically tunes settings for your environment using timescaledb-tune
  • Sets up a persistent data volume
Option 2: Manual Docker command also used for Windows

Alternatively, you can run TimescaleDB directly with Docker:

docker run -d --name timescaledb \
    -p 6543:5432 \
    -e POSTGRES_PASSWORD=password \
    timescale/timescaledb-ha:pg18

Note: We use port 6543 (mapped to container port 5432) to avoid conflicts if you have other PostgreSQL instances running on the standard port 5432.

Wait about 1-2 minutes for TimescaleDB to download & initialize.

Step 2: Connect to TimescaleDB

Connect using psql:

psql -h localhost -p 6543 -U postgres
# When prompted, enter password: password

You should see the PostgreSQL prompt. Verify TimescaleDB is installed:

SELECT extname, extversion FROM pg_extension WHERE extname = 'timescaledb';

Expected output:

   extname   | extversion
-------------+------------
 timescaledb | 2.x.x

Prefer a GUI? If you'd rather use a graphical tool instead of the command line, you can download pgAdmin and connect to TimescaleDB using the same connection details (host: localhost, port: 6543, user: postgres, password: password).

Step 3: Create Your First Hypertable

Let's create a hypertable for IoT sensor data with columnstore enabled:

-- Create a hypertable with automatic columnstore
CREATE TABLE sensor_data (
    time TIMESTAMPTZ NOT NULL,
    sensor_id TEXT NOT NULL,
    temperature DOUBLE PRECISION,
    humidity DOUBLE PRECISION,
    pressure DOUBLE PRECISION
) WITH (
    tsdb.hypertable
);

tsdb.hypertable - Converts this into a TimescaleDB hypertable

See more:

Step 4: Insert Sample Data

Let's add some sample sensor readings:

-- Enable timing to see time to execute queries
\timing on

-- Insert sample data for multiple sensors
-- SET timescaledb.enable_direct_compress_insert = on to insert data directly to the columnstore (columnnar format for performance)
SET timescaledb.enable_direct_compress_insert = on;
INSERT INTO sensor_data (time, sensor_id, temperature, humidity, pressure)
SELECT
    time,
    'sensor_' || ((random() * 9)::int + 1),
    20 + (random() * 15),
    40 + (random() * 30),
    1000 + (random() * 50)
FROM generate_series(
    NOW() - INTERVAL '90 days',
    NOW(),
    INTERVAL '1 seconds'
) AS time;

-- Once data is inserted into the columnstore we optimize the order and structure 
-- this compacts and orders the data in the chunks for optimal query performance and compression
DO $$
DECLARE ch TEXT;
BEGIN
    FOR ch IN SELECT show_chunks('sensor_data') LOOP
        CALL convert_to_columnstore(ch, recompress := true);
    END LOOP;
END $$;

This generates ~7,776,001 readings across 10 sensors over the past 90 days.

Verify the data was inserted:

SELECT COUNT(*) FROM sensor_data;

Step 5: Run Your First Analytical Queries

Now let's run some analytical queries that showcase TimescaleDB's performance:

-- Enable query timing to see performance
\timing on

-- Query 1: Average readings per sensor over the last 7 days
SELECT
    sensor_id,
    COUNT(*) as readings,
    ROUND(AVG(temperature)::numeric, 2) as avg_temp,
    ROUND(AVG(humidity)::numeric, 2) as avg_humidity,
    ROUND(AVG(pressure)::numeric, 2) as avg_pressure
FROM sensor_data
WHERE time > NOW() - INTERVAL '7 days'
GROUP BY sensor_id
ORDER BY sensor_id;

-- Query 2: Hourly averages using time_bucket 
-- Time buckets enable you to aggregate data in hypertables by time interval and calculate summary values.
SELECT
    time_bucket('1 hour', time) AS hour,
    sensor_id,
    ROUND(AVG(temperature)::numeric, 2) as avg_temp,
    ROUND(AVG(humidity)::numeric, 2) as avg_humidity
FROM sensor_data
WHERE time > NOW() - INTERVAL '24 hours'
GROUP BY hour, sensor_id
ORDER BY hour DESC, sensor_id
LIMIT 20;

-- Query 3: Daily statistics across all sensors
SELECT
    time_bucket('1 day', time) AS day,
    COUNT(*) as total_readings,
    ROUND(AVG(temperature)::numeric, 2) as avg_temp,
    ROUND(MIN(temperature)::numeric, 2) as min_temp,
    ROUND(MAX(temperature)::numeric, 2) as max_temp
FROM sensor_data
GROUP BY day
ORDER BY day DESC
LIMIT 10;

-- Query 4: Latest reading for each sensor
-- Highlights the value of Skipscan executing in under 100ms without skipscan it takes over 5sec
SELECT DISTINCT ON (sensor_id)
    sensor_id,
    time,
    ROUND(temperature::numeric, 2) as temperature,
    ROUND(humidity::numeric, 2) as humidity,
    ROUND(pressure::numeric, 2) as pressure
FROM sensor_data
ORDER BY sensor_id, time DESC;

Notice how fast these analytical queries run, even with aggregations across millions of rows. This is the power of TimescaleDB's columnstore.

What's Happening Behind the Scenes?

TimescaleDB automatically:

  • Partitions your data into time-based chunks for efficient querying
  • Write directly to columnstore using columnar storage (90%+ compression typical) and faster vectorized queries
  • Optimizes queries by only scanning relevant time ranges and columns
  • Enables time_bucket() - a powerful function for time-series aggregation

See more:

Next Steps

Now that you've got the basics, explore more:

Create Continuous Aggregates

Continuous aggregates make real-time analytics run faster on very large datasets. They continuously and incrementally refresh a query in the background, so that when you run such query, only the data that has changed needs to be computed, not the entire dataset. This is what makes them different from regular PostgreSQL materialized views, which cannot be incrementally materialized and have to be rebuilt from scratch every time you want to refresh them.

Let's create a continuous aggregate for hourly sensor sta

readme truncated — read the full docs on github

Frequently asked questions

Is TimescaleDb free to use?

TimescaleDb is open source. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does TimescaleDb do?

Time-series database built on top of PostgreSQL

What is TimescaleDb written in?

TimescaleDb is primarily written in C. Its source is publicly available at https://github.com/timescale/timescaledb, and it has 23,540 GitHub stars.