Issue
In some cases you could find that your database is spending a lot of time procesing this query:
SELECT fileEntryId, groupId, companyId, userId, userName, createDate, modifiedDate, classNameId, classPK, repositoryId, folderId, treePath, name, extension, mimeType, title, description, extraSettings, fileEntryTypeId, version, size_, readCount, smallImageId, largeImageId, custom1ImageId, custom2ImageId, manualCheckInRequired FROM DLFileEntry WHERE (smallImageId = 1) OR (largeImageId = 1) OR (custom1ImageId = 1) OR (custom2ImageId = 1)
It has 4 OR clauses in its WHERE, so it produces a Full Scan in the table. This is a real example of how it could impact you:
Resolution
You may not need this query to be executed. To test if it's useful to you, run this queries:
select count(*) from DLFileEntry where custom2ImageId > 0;
select count(*) from DLFileEntry where custom1ImageId > 0;
select count(*) from DLFileEntry where largeImageId > 0;
select count(*) from DLFileEntry where smallImageId > 0;
If all of them return 0 as result the original query is not useful and you could reduce it's use by modifiying this property:
web.server.servlet.check.image.gallery
And setting this as false.