I am taking gps data and drawing a map, I would like to show the maximum speed at various points. I would need to keep track of the speed value for each data point and if it decreases mark the previous point as a max value.
Is this something i could do nicely in MySql, or do I just loop though it in php and get the values. It is quite simple to do via php, but includes pulling out loads of data that is not really required.
One data set could be up to 20k rows give or take a few thousand.
From the graph below I would expect 4 data points back. Table structure is simple id, long, lat, speed (not that it matters much)
EDIT:
id is a uuid, not integer :/

Assuming you have ids > 0:
This will compare the last speed with the current speed, give the last rising id and speed for every falling interval, 0 and the speed for all other cases in the inner query. From that we select only those rows, that have a positive id