setup-timescaledb-hypertables

Design TimescaleDB hypertables for insert-heavy time-series workloads.

1.8k|104|Updated Jul 23, 2025
One-click install
npx skills add https://github.com/timescale/pg-aiguide --skill setup-timescaledb-hypertables-timescale
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-timescaledb-hypertables
Source: https://github.com/timescale/pg-aiguide/tree/main/skills/setup-timescaledb-hypertables
Command: npx skills add https://github.com/timescale/pg-aiguide --skill setup-timescaledb-hypertables-timescale

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides DB engineers in designing and deploying TimescaleDB hypertables for insert-heavy time-series workloads such as sensors, IoT devices, metrics dashboards, and logs. It emphasizes choosing the right partition column, chunk intervals, and compression policies to maximize ingest throughput and query performance.

Core Features & Use Cases

  • Hypertable creation guidance: step-by-step creation with proper partitioning and chunk intervals.
  • Compression and retention planning: configure columnstore and retention policies for long-term storage and cost efficiency.
  • Continuous aggregates and policies: set up refresh policies for near-real-time dashboards and historical reporting.
  • Performance best practices: index strategy, query patterns, and maintenance considerations for large-scale time-series data.

Quick Start

Example: Create a hypertable on a sensor_data table with a timestamp column and a suitable partition column, then enable compression and a 7-day retention policy. Adjust parameters to fit your workload.

Frequently Asked Questions about setup-timescaledb-hypertables

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a TimescaleDB hypertable for insert-heavy time-series workloads?

To create a TimescaleDB hypertable, you need a table with a time column, then call the creation function specifying your partition column and chunk interval. This Skill guides you through selecting optimal chunk intervals to maximize ingest throughput for sensors, IoT, metrics, and logs.

What is the best way to configure compression and retention policies for time-series data?

The best way to configure compression and retention is to enable columnstore compression and set a retention policy based on your storage costs and historical query needs. This Skill helps you plan these policies for long-term storage efficiency on hypertables.

How do continuous aggregates improve query performance for time-series dashboards?

Continuous aggregates improve time-series dashboard performance by pre-calculating and refreshing aggregated data in the background. This Skill provides SQL patterns to set up refresh policies for near-real-time dashboards and historical reporting on hypertables.

Do I need the TimescaleDB extension to use hypertables and continuous aggregates?

Yes, you need the TimescaleDB extension installed to use hypertables, continuous aggregates, and compression policies. This Skill requires the extension and covers SQL patterns for proper partitioning and maintenance.

What chunk interval should I choose for partitioning time-series metrics?

Choosing the right chunk interval for partitioning time-series metrics depends on your data ingest rate and query patterns. This Skill provides guidance on selecting suitable chunk intervals to ensure optimal query performance and maintenance on hypertables.