Reputation: 11
I have installed Postgresql 12 with TimescaleDB.
I have two tables in database
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 ?
Upvotes: 1
Views: 2686
Reputation: 1412
What is the insert rate that you achieved?
How many sensor_id
s are you emulating?
I'm doing similar tests right now and using tsbs and probably it can give you some insights about it without needing to recreate all the scenarios.
If you query the data you'll see a huge difference because the query planner will have faster parallel interaction over several chunks.
You can also compress your data and segment the compression by sensor_id which will make it really fast to query the data by time and sensor_id.
I'd start trying to also run with different chunk intervals (reduce it) as 20M records per chunk is also a very huge amount of data.
Upvotes: 1