timescale-lifecycle-ops

Automate TimescaleDB hypertable compression, retention, and downsampling policies.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill timescale-lifecycle-ops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: timescale-lifecycle-ops
Source: https://github.com/filimorniga-ux/farmacias-vallenar-suit/tree/main/.agent/skills/timescale-lifecycle
Command: npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill timescale-lifecycle-ops

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the data lifecycle operations needed to avoid storage bloat and performance degradation in TimescaleDB hypertables by prescribing compression, retention, and downsampling policies.

Core Features & Use Cases

  • Policy-as-code guidance for creating compression policies, retention rules, and continuous aggregate downsampling to protect long-term performance.
  • Targeted scope for tables used as logs, audits, and sales history in high-volume transactional systems where space and query speed are critical.
  • Operational best practices such as segment-by keys, configurable intervals, and using continuous aggregates for historical reporting while deleting raw data when appropriate.

Quick Start

Create compression and retention policies for the ventas and sync_logs hypertables with a 30-day compression interval and a 3-month retention policy.

Frequently Asked Questions about timescale-lifecycle-ops

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

FAQPage Schema
How do I automate TimescaleDB hypertable lifecycle management to prevent storage bloat?

Automate TimescaleDB hypertable lifecycle management by applying policy-as-code for compression, retention cleanup, and continuous aggregate downsampling. This prevents storage bloat and performance degradation in high-volume transactional tables like logs, audits, and sales history.

How do I set up compression and retention policies for TimescaleDB hypertables?

Set up TimescaleDB compression and retention policies by configuring specific intervals, such as a 30-day compression interval and a 3-month retention policy. You must also define segment-by keys to optimize how the hypertable data is stored and queried.

What is the best way to downsample historical data in TimescaleDB while deleting raw records?

The best way to downsample TimescaleDB historical data is by using continuous aggregates for historical reporting. This downsampling approach preserves query speed while allowing you to apply retention rules that delete raw data when it is no longer needed.

Can I use continuous aggregates for sales history reporting in high-volume telemetry workloads?

Yes, continuous aggregates are targeted specifically for high-volume transactional and telemetry workloads like sales history. They provide the operational best practice of maintaining historical reporting capabilities while underlying raw data undergoes retention cleanup.

Why does TimescaleDB storage bloat occur and when do I need lifecycle policies?

TimescaleDB storage bloat occurs when high-volume hypertables holding logs, audits, and sales history grow unchecked. You need lifecycle policies when space and query speed become critical and require automated retention, compression, and downsampling.

Do I need to specify segmentby keys when configuring TimescaleDB compression policies?

Yes, specifying segmentby keys is an operational best practice when configuring TimescaleDB compression policies. These keys determine how data is segmented during compression, directly impacting storage efficiency and query performance.