admin/master_files display is VERY slow to load
sdm7g opened this issue · 2 comments
From looking at the logs, 2/3 or more of the overhead appears to be from these two MySQL queries,
which are used in the column headers:
(47046.9ms) SELECT COUNT() FROM master_files
WHERE master_files
.type
= 'Tiff'
(22881.9ms) SELECT COUNT() FROM master_files
WHERE master_files
.type
= 'JpegTwoThousand'
If there isn't a way to effectively cache these queries, maybe we can just eliminate them from the display but keep them as search options. They are always showing 0 JP2K master files anyway -- Can that even be correct ?
On further investigation, it turns out that those counts for JP2Ks are incorrect, because the type fields for those JP2k MasterFiles is incorrectly = nil.
I suggest that we turn off those two scope fields in production, since they are not currently working correctly and produce a lot of overhead, and look at both correcting them and fixing performance later.
for example, see:
https://tracksys.lib.virginia.edu/admin/master_files?q%5Bunit_id_eq%5D=28951
We did remove those fields, at least for now, and performance is much improved.
Provisionally closing for now, but we need to look further at optimizations. In general, many pages load too slowly.