0
Good morning Guys, all right?
I have a performance problem in a system and need to solve by customizing an SQL.
Let us imagine the following scenario: - A table with millions of records, each record has an ID (PK) and a TIMESTAMP.
Currently, I consult the data by the TIMESTAMP interval, for example, last week’s records.
We consider that in this one-week period has 1,000,000 (one million) records. Currently resgato these values to create a graph.
Let us agree that this is costly and somewhat stupid since from one record to the other there is minimal change of values and I need to assemble a line graph where the value of X is the TIMESTAMP.
DOUBT: You have to determine to the bank to consult me this interval but bring me up to 1,000 records only? But these records would have to come spaced out in order to understand the whole period, it would be a kind of sampling. Trying to process this in the system programming is sendable.
I leave you my thanks so you can help me, Gustavo Ferreira.
Tried to put a LIMIT 0.1000 for example?
– Diego
No. I don’t want the first 1000 records, I want 1000 distributed among the 1,000,000.
– Gustavo