- #1
- 4,219
- 67
I have a MySQL database and I have the problem that queries take way too much time. I want to optimize the database and one way would be to save data into a string, instead of in rows (the string would be replicates of the same condition).
Each string is an interval of 4 seconds, to reduce the number of rows further I want to sum the data into 30-minute intervals. How can I sum strings? I'd like to use PHP for that. Shall I push replicates into an array?
NULL values may be present
To illustrate:
time 1: 0,1,0,1,1,1,0
time 2: 1,1,0,,0,1,1
sum time 1+2: 1,2,0,1,1,2,1
Each string is an interval of 4 seconds, to reduce the number of rows further I want to sum the data into 30-minute intervals. How can I sum strings? I'd like to use PHP for that. Shall I push replicates into an array?
NULL values may be present
To illustrate:
time 1: 0,1,0,1,1,1,0
time 2: 1,1,0,,0,1,1
sum time 1+2: 1,2,0,1,1,2,1
Last edited: