Home / Companies / Tiger Data / Blog / Post Details
Content Deep Dive

Optimizing queries on TimescaleDB hypertables with thousands of partitions

Blog post from Tiger Data

Post Details
Company
Date Published
Author
Matvey Arye
Word Count
744
Company Posts That Month
1
Language
English
Hacker News Points
-
Post removed?
No
Summary

The problem lies in the query planning process of Postgres, which takes a long time for tables with many partitions, leading to performance degradation even when not processing all chunks in hypertables. The culprit was found to be in the `get_relation_info()` function, which fetches table statistics and opens metadata files from heap data files for all chunks, resulting in unnecessary work if chunk exclusion is possible. An optimization has been made by moving chunk exclusion to before stats are fetched, reducing planning times significantly in tests with large datasets, even when only a few chunks were involved.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.