I have installed Postgresql 12 with TimescaleDB.
I have two tables in database
- Sensor_Data
- Sensor_Data_TS (Timescale Hypertable). Both the tables have same columns, same data and indexing is done on sensor_id and time in both the tables.
Now when queries are executed to insert or query data from these two tables to check performance difference, query time is coming almost same. I have inserted around 500 Million records to check the performance difference but sometimes Sensor_Data table is returning data faster than hypertable.
Queries run to create hypertable.
CREATE TABLE Sensor_Data_TS (LIKE Sensor_Data INCLUDING DEFAULTS INCLUDING CONSTRAINTS EXCLUDING INDEXES);
SELECT create_hypertable('Sensor_Data_TS', 'time', chunk_time_interval => 86400000);
CREATE INDEX ON Sensor_Data_TS (sensor_id, time DESC);
Used "timescaledb-tune" command to configure properties for TimescaleDB.
I want to know if i am doing any mistake in configuring the hypertable ? How can I achieve fast performance with timescaleDB as they claim on their website ?