Forum Discussion

Julio_Silva's avatar
Julio_Silva
Copper Contributor
Apr 30, 2024

Slow Table with lot of registers

Hello,

I have a database with a big table that I store sensor values, basically the structure is

ID, DataTime, SensorID, Value.

Each sensor sends data each minute, I have more than 100 sensors, so every day is a lot of records (more than 20.000.000 each month)...

2/3 months is not bad, but more than that is getting slow every time I want to do a graph, doing a

"select ... where data>X and data<y and sensorid=z"

How can I speed up things and make this more efficient?

Thanks for any tip.

 

JS

 

1 Reply

  • olafhelper's avatar
    olafhelper
    Bronze Contributor

    "select ... where data>X and data<y and sensorid=z"

    How can I speed up things and make this more efficient?


    Have you created a suitabel index for your query?

Resources