2017-02-26, 07:14
The update watched status script kept timing out on me (close to 20000 rows in each of the tables)
I fixed it by adding a "IS NOT NULL" check
Using your example script, this is how I improved it:
This took the script from running into a timeout after 10 minutes down to slightly over 3 minutes
I fixed it by adding a "IS NOT NULL" check
Using your example script, this is how I improved it:
PHP Code:
------------------------------
--- COPY OVER WATCH STATUS ---
------------------------------
SET SQL_SAFE_UPDATES = 0;
UPDATE Kodi_Matt_Video_T_107.global_files AS NEWTBL
INNER JOIN
Kodi_Matt_Video_93.globalfiles AS OLDTBL ON NEWTBL.strFilename = OLDTBL.strFilename
SET
NEWTBL.lastPlayed_U01 = OLDTBL.lastPlayedMatt,
NEWTBL.playCount_U01 = OLDTBL.playCountMatt
WHERE
NEWTBL.strFilename = OLDTBL.strFilename AND OLDTBL.lastPlayedMatt IS NOT NULL;
SET SQL_SAFE_UPDATES = 1;
This took the script from running into a timeout after 10 minutes down to slightly over 3 minutes