Roger Fell : More trainer_ids to merge
By Henry Young on Thursday, October 24th, 2024Last year I wrote about Mark Johnston partnering with then handing over his trainers license to his son Charlie and the impact this had on Smartform’s trainer_id
. Those of us who like to aggregate data by trainer_id
, for example to generate trainer strike rates, might wish to acknowledge that the Johnstons’ yard and training methods remained substantially the same through this handover of the reins (pun intended) by merging all the various trainer_id
values together into one. Well, it’s happened again …
Roger Fell’s yard has been going through some drama with the addition of Sean Murray as a partner on the trainer’s license. However Sean’s name has more recently disappeared from the license. Roger Fell continues in his own right, an example to all of us, still working at age 70. One consequence is that Smartform’s data provider has changed trainer_id
, but only when Sean Murray was dropped, not when he was added. We can observe this with the following query:
select distinct trainer_id, trainer_name from historic_runners_beta where trainer_name like "%Fell%";
+------------+--------------------------+
| trainer_id | trainer_name |
+------------+--------------------------+
| 1220 | R Fell |
...
| 128659 | Roger Fell |
| 128659 | Roger Fell & Sean Murray |
| 161959 | Roger Fell |
+------------+--------------------------+
5 rows in set (6.30 sec)
Note there is an unrelated trainer whose name contains “Fell” whom I have removed from the results table for clarity.
The first thing we see is that when Sean joined the trainer license, the trainer_id
remained the same. But when Sean left the license, a new trainer_id
was created for Roger on his own. If you take the view that nothing significant has changed about how the yard is run, the staff, the training methods, etc, you may prefer to see results from all four Fell licenses under a single trainer_id
. This can be done with the following SQL script:
SET SQL_SAFE_UPDATES = 0;
UPDATE historic_runners_beta SET trainer_id = 161959 WHERE trainer_name = "R Fell";
UPDATE historic_runners_beta SET trainer_id = 161959 WHERE trainer_name = "Roger Fell";
UPDATE historic_runners_beta SET trainer_id = 161959 WHERE trainer_name = "M Johnston";
SET SQL_SAFE_UPDATES = 1;
Note that here we are using the newest trainer_id
to tag all past results. This means the modification is a one-time deal and all future runners/races will continue to use the same trainer_id
. If we had used any of the older trainer_id
values, we would have to apply the fix script every day, which would be far less convenient.
This concept is easily extended to other trainer changes. For example, if your would like aggregated stats for the partnership between Rachel Cook and John Bridger to be merged with John’s longer standing stats, you can add the following to your script:
UPDATE historic_runners_beta SET trainer_id = 157470 WHERE trainer_name = "J J Bridger";
If you find there are other trainer name changes that have resulted in a new trainer_id
which you would prefer to see merged, you can apply similar techniques.
If you know of other cases of trainer name changes which represent a continuation of substantially the same yard, please feel free to comment …