Analysis of the Impact of Optimizer Statistics and Query Execution Parameters on Aggregation Performance in Standard PostgreSQL Tables and TimescaleDB Hypertables, Using Temperature and Humidity Measurements as a Case Study

Abstract:

This article presents a comparative performance analysis of PostgreSQL and TimescaleDB in processing and aggregating time-series data, using temperature and humidity measurements as an example. The study was conducted on a dataset of one million records stored in conventional PostgreSQL tables and TimescaleDB hypertables. Five experimental stages were carried out to investigate the influence of table organization, optimizer statistics, statistical estimation accuracy, parallel query execution, and memory allocation on query performance. The results demonstrated that TimescaleDB provided better performance under default settings, while PostgreSQL achieved significantly shorter execution times after query optimization. The study highlights the importance of proper database configuration and demonstrates the potential of open-source database technologies for efficient processing of measurement data.