[perf] MIME type repair step takes hours on large instances #48698
Open
Description
Running the MIME type repair step can take up to multiple hours on large instances, as the filecache table is pretty huge.
A possible solution would be to do this not within the repair steps but only start a background job from the repair step that then will do the repair in chunks.
E.g.
- Get the current largest fileid
- start a background job A with (start=0, end=fileid)
- Update the mime types in that background job but only in the chunk [start, min(start+5000, end)]
- start the background job again from that background job with (start = start + 5000, end=fileid) if needed
(5000 is just taken as an example as this should not lock the table on mysql and thus should not block the production instance too heavily).
Activity