@John-C-B
Did you run this query for me ? and establish which version of Plex Media Server was running on the 24th October ?
Before running the sql.txt sqlite3 transaction - did you actually run the step 2 action quoted in this linked post Slow library performance due to increasingly growing database - #28 by shayanzadeh
which would be
DELETE FROM metadata_relations WHERE metadata_item_id = '45323';