This question follows on from a previous which was expertly solved, but i've now made changes to the db and requirements, it is a little more complex.
The db is for a running club. I need to return the top 3 personal best times, by distance and age category. The query that we have working produces the results, but is VERY slow to produce them - so the question is, what can be done to improve the queries efficiency - have we got it very wrong?
My top 3 personal bests, I refer to individuals. For example, one person alone may hold the top 3 best times themselves, but for this exercise, the only their best counts,
Paul G - 0:20:00
Paul G - 0:20:21
PaulG - 0:20:22
FredB - 0:20:35
FredB - 0:20:40
GaryC - 0:21:00
So the top 3 in this case needs to show PaulG - 0:20:00 / FredB - 0:20:35 / GaryC - 0:21:00
(Gold, silver & bronze positions)
So as a grid, the results should look something like ...
--> Distance (10k)
------> RaceCat (35) - this is an age (35/40/45/50 etc)
------------->Pos1 / Pos2 / Pos3
I have attached our db for real world reference - the results itself table has over 23000 records.
Many thanks in advance for assistance.