Agent skill

Find Hypertable Candidates

by timescale in timescale/pg-aiguide

A skill your agent uses to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.

Apache-2.0Auto-check passedData & Analytics

Install Find Hypertable Candidates

skills CLI
$ npx skills add timescale/pg-aiguide --skill find-hypertable-candidates -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install timescale/pg-aiguide find-hypertable-candidates --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/timescale/pg-aiguide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/find-hypertable-candidates .claude/skills/find-hypertable-candidates && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
find-hypertable-candidates
GitHub stars
1.9k
Used in
1 other repo
Token cost
~2.6k tokens
SKILL.md length
581 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.

  • Works in 2 steps: Database Schema Analysis → Candidacy Scoring (8+ points = good…
  • Analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables
  • SKILL.md covers TimescaleDB Benefits, Step 1: Database Schema Analysis, Step 2: Candidacy Scoring (8+… and Common Patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Find Hypertable Candidates is an agent skill from timescale/pg-aiguide. Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. Trigger when user asks to: - Analyze database tables for hypertable conversion potential - Identify time-series or event tables in an existing schema - Evaluate if a table would benefit from Timescale/TimescaleDB - Audit PostgreSQL tables for migration to Timescale/TimescaleDB/TigerData - Score or rank tables for hypertable candidacy Keywords: hypertable candidate, table…

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Requires PostgreSQL 15+ with TimescaleDB

It sits in Data & Analytics, covering Forecasting and time series, Statistics and SQL. It works with PostgreSQL, SQL and Model Context Protocol. The repository describes itself as: MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code. The licence is Apache-2.0.

When your agent uses it

  • Analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables
  • User asks to: - Analyze database tables for hypertable conversion potential - Identify time-series
  • Rank tables for hypertable candidacy Keywords: hypertable candidate
  • Migration assessment

Example prompts

  • “/find-hypertable-candidates”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Requires PostgreSQL 15+ with TimescaleDB

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Database Schema Analysis
  2. Candidacy Scoring (8+ points = good candidate)

What it can do on your machine

Read from SKILL.md and the folder at commit 187be00. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires PostgreSQL 15+ with TimescaleDB

    From compatibility in the SKILL.md frontmatter.

Context cost

Find Hypertable Candidates loads about 2.6k tokens when it runs. Until then it costs about 224 tokens; SKILL.md has 581 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~224
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from timescale/pg-aiguide at commit 187be00, republished under its Apache-2.0 licence (© timescale). 581 words, ~2,621 tokens.

Download SKILL.mdSave it as .claude/skills/find-hypertable-candidates/SKILL.md (or your agent's skills folder).
name
find-hypertable-candidates
description
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. **Trigger when user asks to:** - Analyze database tables for hypertable conversion potential - Identify time-series or event tables in an existing schema - Evaluate if a table would benefit from Timescale/TimescaleDB - Audit PostgreSQL tables for migration to Timescale/TimescaleDB/TigerData - Score or rank tables for hypertable candidacy **Keywords:** hypertable candidate, table analysis, migration assessment, Timescale, TimescaleDB, time-series detection, insert-heavy tables, event logs, audit tables Provides SQL queries to analyze table statistics, index patterns, and query patterns. Includes scoring criteria (8+ points = good candidate) and pattern recognition for IoT, events, transactions, and sequential data.
compatibility
Requires PostgreSQL 15+ with TimescaleDB
license
Apache-2.0
metadata.author
tigerdata

PostgreSQL Hypertable Candidate Analysis

Identify tables that would benefit from TimescaleDB hypertable conversion. After identification, use the companion "migrate-postgres-tables-to-hypertables" skill for configuration and migration.

TimescaleDB Benefits

Performance gains: 90%+ compression, fast time-based queries, improved insert performance, efficient aggregations, continuous aggregates for materialization (dashboards, reports, analytics), automatic data management (retention, compression).

Best for insert-heavy patterns:

  • Time-series data (sensors, metrics, monitoring)
  • Event logs (user events, audit trails, application logs)
  • Transaction records (orders, payments, financial)
  • Sequential data (auto-incrementing IDs with timestamps)
  • Append-only datasets (immutable records, historical)

Requirements: Large volumes (1M+ rows), time-based queries, infrequent updates

Step 1: Database Schema Analysis

Option A: From Database Connection
Table statistics and size
sql
-- Get all tables with row counts and insert/update patterns
WITH table_stats AS (
    SELECT
        schemaname, tablename,
        n_tup_ins as total_inserts,
        n_tup_upd as total_updates,
        n_tup_del as total_deletes,
        n_live_tup as live_rows,
        n_dead_tup as dead_rows
    FROM pg_stat_user_tables
),
table_sizes AS (
    SELECT
        schemaname, tablename,
        pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as total_size,
        pg_total_relation_size(schemaname||'.'||tablename) as total_size_bytes
    FROM pg_tables
    WHERE schemaname NOT IN ('information_schema', 'pg_catalog')
)
SELECT
    ts.schemaname, ts.tablename, ts.live_rows,
    tsize.total_size, tsize.total_size_bytes,
    ts.total_inserts, ts.total_updates, ts.total_deletes,
    ROUND(CASE WHEN ts.live_rows > 0
          THEN (ts.total_inserts::float / ts.live_rows) * 100
          ELSE 0 END, 2) as insert_ratio_pct
FROM table_stats ts
JOIN table_sizes tsize ON ts.schemaname = tsize.schemaname AND ts.tablename = tsize.tablename
ORDER BY tsize.total_size_bytes DESC;

Look for:

  • mostly insert-heavy patterns (less updates/deletes)
  • big tables (1M+ rows or 100MB+)
Index patterns
sql
-- Identify common query dimensions
SELECT schemaname, tablename, indexname, indexdef
FROM pg_indexes
WHERE schemaname NOT IN ('information_schema', 'pg_catalog')
ORDER BY tablename, indexname;

Look for:

  • Multiple indexes with timestamp/created_at columns → time-based queries
  • Composite (entity_id, timestamp) indexes → good candidates
  • Time-only indexes → time range filtering common
Query patterns (if pg_stat_statements available)
sql
-- Check availability
SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'pg_stat_statements');

-- Analyze expensive queries for candidate tables
SELECT query, calls, mean_exec_time, total_exec_time
FROM pg_stat_statements
WHERE query ILIKE '%your_table_name%'
ORDER BY total_exec_time DESC LIMIT 20;

✅ Good patterns: Time-based WHERE, entity filtering combined with time-based qualifiers, GROUP BY time_bucket, range queries over time ❌ Poor patterns: Non-time lookups with no time-based qualifiers in same query (WHERE email = ...)

Constraints
sql
-- Check migration compatibility
SELECT conname, contype, pg_get_constraintdef(oid) as definition
FROM pg_constraint
WHERE conrelid = 'your_table_name'::regclass;

Compatibility:

  • Primary keys (p): Must include partition column or ask user if can be modified
  • Foreign keys (f): Plain→Hypertable and Hypertable→Plain OK, Hypertable→Hypertable NOT supported
  • Unique constraints (u): Must include partition column or ask user if can be modified
  • Check constraints (c): Usually OK
Option B: From Code Analysis
✅ GOOD Patterns
python
# Append-only logging
INSERT INTO events (user_id, event_time, data) VALUES (...);
# Time-series collection
INSERT INTO metrics (device_id, timestamp, value) VALUES (...);
# Time-based queries
SELECT * FROM metrics WHERE timestamp >= NOW() - INTERVAL '24 hours';
# Time aggregations
SELECT DATE_TRUNC('day', timestamp), COUNT(*) GROUP BY 1;
❌ POOR Patterns
python
# Frequent updates to historical records
UPDATE users SET email = ..., updated_at = NOW() WHERE id = ...;
# Non-time lookups
SELECT * FROM users WHERE email = ...;
# Small reference tables
SELECT * FROM countries ORDER BY name;
Schema Indicators

✅ GOOD:

  • Has timestamp/timestamptz column
  • Multiple indexes with timestamp-based columns
  • Composite (entity_id, timestamp) indexes

❌ POOR:

  • Mostly indexes with non-time-based columns (on columns like email, name, status, etc.)
  • Columns that you expect to be updated over time (updated_at, updated_by, status, etc.)
  • Unique constraints on non-time fields
  • Frequent updated_at modifications
  • Small static tables
Special Case: ID-Based Tables

Sequential ID tables can be candidates if:

  • Insert-mostly pattern / updates are either infrequent or only on recent records.
  • If updates do happen, they occur on recent records (such as an order status being updated orderered->processing->delivered. Note once an order is delivered, it is unlikely to be updated again.)
  • IDs correlate with time (as is the case for serial/auto-incrementing IDs/GENERATED ALWAYS AS IDENTITY)
  • ID is the primary query dimension
  • Recent data accessed more often (frequently the case in ecommerce, finance, etc.)
  • Time-based reporting common (e.g. monthly, daily summaries/analytics)
sql
CREATE TABLE orders (
    id BIGSERIAL PRIMARY KEY,           -- Can partition by ID
    user_id BIGINT,
    created_at TIMESTAMPTZ DEFAULT NOW() -- For sparse indexes
);

Note: For ID-based tables where there is also a time column (created_at, ordered_at, etc.), you can partition by ID and use sparse indexes on the time column. See the migrate-postgres-tables-to-hypertables skill for details.

Show full SKILL.md (174 more words)Show less

Step 2: Candidacy Scoring (8+ points = good candidate)

Time-Series Characteristics (5+ points needed)
  • Has timestamp/timestamptz column: 3 points
  • Data inserted chronologically: 2 points
  • Queries filter by time: 2 points
  • Time aggregations common: 2 points
  • Large table (1M+ rows or 100MB+): 2 points
  • High insert volume: 1 point
  • Infrequent updates to historical: 1 point
  • Range queries common: 1 point
  • Aggregation queries: 2 points
Data Patterns (bonus)
  • Contains entity ID for segmentation (device_id, user_id, product_id, symbol, etc.): 1 point
  • Numeric measurements: 1 point
  • Log/event structure: 1 point

Common Patterns

✅ GOOD Candidates

✅ Event/Log Tables (user_events, audit_logs)

sql
CREATE TABLE user_events (
    id BIGSERIAL PRIMARY KEY,
    user_id BIGINT,
    event_type TEXT,
    event_time TIMESTAMPTZ DEFAULT NOW(),
    metadata JSONB
);
-- Partition by id, segment by user_id, enable minmax sparse_index on event_time

✅ Sensor/IoT Data (sensor_readings, telemetry)

sql
CREATE TABLE sensor_readings (
    device_id TEXT,
    timestamp TIMESTAMPTZ,
    temperature DOUBLE PRECISION,
    humidity DOUBLE PRECISION
);
-- Partition by timestamp, segment by device_id, minmax sparse indexes on temperature and humidity

✅ Financial/Trading (stock_prices, transactions)

sql
CREATE TABLE stock_prices (
    symbol VARCHAR(10),
    price_time TIMESTAMPTZ,
    open_price DECIMAL,
    close_price DECIMAL,
    volume BIGINT
);
-- Partition by price_time, segment by symbol, minmax sparse indexes on open_price and close_price and volume

✅ System Metrics (monitoring_data)

sql
CREATE TABLE system_metrics (
    hostname TEXT,
    metric_time TIMESTAMPTZ,
    cpu_usage DOUBLE PRECISION,
    memory_usage BIGINT
);
-- Partition by metric_time, segment by hostname, minmax sparse indexes on cpu_usage and memory_usage
❌ POOR Candidates

❌ Reference Tables (countries, categories)

sql
CREATE TABLE countries (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100),
    code CHAR(2)
);
-- Static data, no time component

❌ User Profiles (users, accounts)

sql
CREATE TABLE users (
    id BIGSERIAL PRIMARY KEY,
    email VARCHAR(255),
    created_at TIMESTAMPTZ,
    updated_at TIMESTAMPTZ
);
-- Accessed by ID, frequently updated, has timestamp but it's not the primary query dimension (the primary query dimension is id or email)

❌ Settings/Config (user_settings)

sql
CREATE TABLE user_settings (
    user_id BIGINT PRIMARY KEY,
    theme VARCHAR(20),       -- Changes: light -> dark -> auto
    language VARCHAR(10),    -- Changes: en -> es -> fr
    notifications JSONB,     -- Frequent preference updates
    updated_at TIMESTAMPTZ
);
-- Accessed by user_id, frequently updated, has timestamp but it's not the primary query dimension (the primary query dimension is user_id)

Analysis Output Requirements

For each candidate table provide:

  • Score: Based on criteria (8+ = strong candidate)
  • Pattern: Insert vs update ratio
  • Access: Time-based vs entity lookups
  • Size: Current size and growth rate
  • Queries: Time-range, aggregations, point lookups

Focus on insert-heavy patterns with time-based or sequential access. Tables scoring 8+ points are strong candidates for conversion.

© timescale, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/find-hypertable-candidates of timescale/pg-aiguide.

Open the folder on GitHubat commit 187be00

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in timescale/pg-aiguide, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Find Hypertable Candidates next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Find Hypertable Candidates compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Find Hypertable Candidates this skilltimescale/pg-aiguide1.9k1 repos~2.6kAutomated safety check: PassApache-2.0
SlKaelio/ktx1.6k—~2.7kAutomated safety check: PassApache-2.0
NpgsqlrestNpgsqlRest/NpgsqlRest132—~7kAutomated safety check: NotesMIT
Semantic Analystsidequery/sidemantic129—~982Automated safety check: PassAGPL-3.0
Aurora Dsqlaws/agent-toolkit-for-aws2.8k—~9.6kAutomated safety check: PassApache-2.0
Relational Database MCP CloudbaseTencentCloudBase/CloudBase-AI-Toolkit1.1k1 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • Sl

    Kaelio/ktx

    ktx's semantic layer - a structured catalog of sources (tables/views), measures, joins, and segments expressed as YAML.

    1.6k GitHub stars~2.7k tokensUpdated 27 days ago
    Data & AnalyticsAuto-check passed
  • Npgsqlrest

    NpgsqlRest/NpgsqlRest

    Build and modify REST APIs with NpgsqlRest — exposing PostgreSQL as HTTP endpoints from two sources (database functions/procedures/tables/views, and plain .sql files), driven by SQL comment…

    132 GitHub stars~7k tokensUpdated 5 days ago
    DatabasesAuto-check: notes
  • Semantic Analyst

    sidequery/sidemantic

    Answer analytical, KPI, metric, trend, cohort, and business-performance questions through a Sidemantic semantic layer.

    129 GitHub stars~982 tokensUpdated yesterday
    DatabasesAuto-check passed
  • Aurora Dsql

    aws/agent-toolkit-for-aws

    Official

    Provisions and manages Aurora DSQL clusters, connects via psql or DSQL Connectors, manages schemas, runs queries, migrates from MySQL, diagnoses query plans, and develops apps on serverless…

    2.8k GitHub stars~9.6k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Relational Database MCP Cloudbase

    TencentCloudBase/CloudBase-AI-Toolkit

    [Deprecated] This is the required documentation for agents operating on the CloudBase Relational Database through MCP.

    1.1k GitHub starsUsed in 1 repo~2.5k tokens
    DatabasesAuto-check passed
  • Cloud SQL Basics

    google/skills

    Official

    This file generates or explains Cloud SQL resources. An agent skill from google/skills.

    21k GitHub stars~973 tokensUpdated today
    DatabasesAuto-check passed

More from timescale/pg-aiguide

All 9 skills in this repo
  • Schema Exploration

    timescale/pg-aiguide

    Explore an existing PostgreSQL database before answering questions about its data or writing SQL.

    1.9k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Pgvector Semantic Search

    timescale/pg-aiguide

    A skill your agent uses for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.

    1.9k GitHub starsUsed in 1 repo~3.8k tokens
    Auto-check passed
  • A skill your agent uses to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation.

    1.9k GitHub starsUsed in 1 repo~3.8k tokens
    Auto-check: warnings
  • Design Postgres Tables

    timescale/pg-aiguide

    A skill your agent uses for general PostgreSQL table design.

    1.9k GitHub stars~4.2k tokensUpdated yesterday
    Auto-check passed
  • Postgres Hybrid Text Search

    timescale/pg-aiguide

    A skill your agent uses to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF).

    1.9k GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Setup Timescaledb Hypertables

    timescale/pg-aiguide

    A skill your agent uses when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data.

    1.9k GitHub stars~4.7k tokensUpdated yesterday
    Auto-check passed

Questions about Find Hypertable Candidates

What does Find Hypertable Candidates do?

A skill your agent uses to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. Find Hypertable Candidates is an agent skill from timescale/pg-aiguide. Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.

When should I use Find Hypertable Candidates?

Find Hypertable Candidates fits situations like: analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables; user asks to: - Analyze database tables for hypertable conversion potential - Identify time-series; rank tables for hypertable candidacy Keywords: hypertable candidate; migration assessment.

How do I install Find Hypertable Candidates in Claude Code?

Run `npx skills add timescale/pg-aiguide --skill find-hypertable-candidates -a claude-code`. Or copy the skill folder (skills/find-hypertable-candidates in timescale/pg-aiguide) into .claude/skills/find-hypertable-candidates in your project. Claude Code loads it when a task matches its description.

How do I install Find Hypertable Candidates in Codex?

Run `npx skills add timescale/pg-aiguide --skill find-hypertable-candidates -a codex`. Or copy the skill folder (skills/find-hypertable-candidates in timescale/pg-aiguide) into .agents/skills/find-hypertable-candidates in your project. Codex loads it when a task matches its description.

Can I use Find Hypertable Candidates in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add timescale/pg-aiguide --skill find-hypertable-candidates -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/find-hypertable-candidates, .gemini/skills/find-hypertable-candidates, .github/skills/find-hypertable-candidates and .opencode/skills/find-hypertable-candidates in your project.

What does Find Hypertable Candidates need to run?

SKILL.md names no scripts, command-line tools or credentials: Find Hypertable Candidates is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): Requires PostgreSQL 15+ with TimescaleDB.

Does Find Hypertable Candidates access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Find Hypertable Candidates safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Find Hypertable Candidates use?

Find Hypertable Candidates is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Find Hypertable Candidates use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Find Hypertable Candidates?

Skills that share tags, products or a category with Find Hypertable Candidates: Sl (Kaelio/ktx, 1.6k stars), Npgsqlrest (NpgsqlRest/NpgsqlRest, 132 stars), Semantic Analyst (sidequery/sidemantic, 129 stars) and Aurora Dsql (aws/agent-toolkit-for-aws, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Find Hypertable Candidates?

timescale (a GitHub organization) maintains it in timescale/pg-aiguide, which has 1,859 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.

Source: timescale/pg-aiguide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.