Looping over 200k files and doing a query for each one means 200k queries. That's going to slow down everything a lot. Plus there is no index on the physical_filename column so that's going to require a full table scan for each query.
Worse case scenario: 200,000 queries x 200,000 rows = 40,000,000,000 rows to test
I would load all the files into an array with
Worse case scenario: 200,000 queries x 200,000 rows = 40,000,000,000 rows to test
I would load all the files into an array with
scandir()
and load all physical_filenames into another array with select physical_filenames from phpbb_attachements
. Then array_diff
.Statistics: Posted by NeoDev — Tue Sep 17, 2024 9:11 pm