The situation is as follows:
I have tens of thousands of sensors (say, 100,000). Each sensor produces regular or irregular time values โโin the form (timestamp, value) . The step width can be less than 1 second, so during the year there can be millions of pairs (timestamp, value) for a particular sensor, forming a time series on the sensor. The user can request values โโfor a period of time (from, to) for such a time series of the sensor.
Saving all values โโin one table ( sensor_id, timestamp, value) fills the table with literally billions of values โโ/ rows per month. This overloads traditional open source databases (MySQL, PostgreSQL).
I am going to create a table for each sensor time interval (timestamp, value) and indicate what is in the sensor table (sensor_id, sensor_name, sensor_table_name) . Thus, there will be 100,000 tables with every million rows.
Is it possible to get values โโdirectly using the sensor_table_name column in my sensor directly, or do I need to make two queries, one to get sensor_table_name and one to get values โโfrom this table?
source share