Automatic recycle bin cleaning is causing huge amount of DB quieries, if there are lot rows at Group table at DB.
Even trash.enabled=false disabling recycle bin from properties file dos not help nor setting trash.entry.check.interval= very high. Since it is anyways doing that on startup.
Requirement to reproduce:
Start Liferay and add huge amount of sites and users (like 50 000).
Then suddenly you find out that db is hitting huge amount of queries and your computer performance is decreasing. From database you see following kind of queries:
select trashentry0_.entryId as entryId458_, trashentry0_.groupId as groupId458_, trashentry0_.companyId as companyId458_, trashentry0_.userId as userId458_, trashentry0_.userName as userName458_, trashentry0_.createDate as createDate458_, trashentry0_.classNameId as classNam7_458_, trashentry0_.classPK as classPK458_, trashentry0_.systemEventSetKey as systemEv9_458_, trashentry0_.typeSettings as typeSet10_458_, trashentry0_.status as status458_ from TrashEntry trashentry0_ where (trashentry0_.groupId=1052961 )AND(trashentry0_.createDate<'2014-01-06 09:15:08' ) order by trashentry0_.createDate DESC
You cannot disable this from portal.properties either by setting trash.enabled=false
It seems to lead to following implementation: