Also, the update is crazy slow. They have these new things called indexes in MySQL now…
For example,consider…
UPDATE episode SET idSeason = 991 WHERE episode.idShow = 60 AND episode.c12 = 608
The problem with this update statement is as follows:
- You need to have indexes on both episode.idShow and episode.c12 (if these are often used together, create a combined index). That would make this statement go much faster, if not for problem two…
- The upgrade is supplying an integer for c12, but the field is varchar(24). That causes bad slowness because for EVERY statement like this (and there are many), MySQL will convert the entire table of varchar(24) c12 values to integers in order to match against the integer in the statement. One solution would be to supply those values in quotes, but the correct fix is to make that field an integer datatype.