We are running Postgres 15.5 w/ Timescale 2.12.2 on an Arm-based Ubuntu EC2 with 4 cores and 32gb of ram. Postgres is configured with timescaledb-tune defaults. We have a hypertable with 55m rows of time series data. There is no compression or anything other than the table and a few indexes.
The hyptertable is set up with:
SELECT create_hypertable('samples',
'start_date',
chunk_time_interval => INTERVAL '2 months',
number_partitions => 4,
partitioning_column => 'company_id');
When running the following query Postgres crashes and restarts every time. We thought there might be corruption in the table so we created a fresh table and re-imported the data. Same result.
select count(sample_type) from samples where device = 'phone'
group by sample_type
There isn’t a lot of information in the PG log files other than:
background worker "parallel worker" (PID 7585) was terminated by signal 11: Segmentation fault
Failed process was running: SELECT...
terminating any other active server processes
all server processes terminated; reinitializing
database system was interrupted
database system was not properly shut down; automatic recovery in progress
Now if we simply remove the where clause it works and takes 2.6s!
select count(sample_type) from samples
group by sample_type
If we add an additional where clause it also works and takes 450ms.
select count(sample_type) from samples where device = 'phone' and company_id = 'x'
group by sample_type
Anyone know what might be going on or how to further diagnose the problem? There is nothing special about the device column. Its type is text and there is no index on the column.
2 posts - 1 participant