Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72494

verifyArticleAssets() generates long running SQL query.

    Details

      Description

      verifyArticleAssets() generates long running SQL query with MySQL 5.6 This query has been defined at : /modules/apps/web-experience/journal/journal-service/src/main/resources/META-INF/custom-sql/default.xml r

      SELECT {JournalArticle.*} FROM JournalArticle LEFT JOIN AssetEntry ON (AssetEntry.classPK = JournalArticle.resourcePrimKey) WHERE AssetEntry.classPK IS NULL 
      

      Run time of this query was more than 5 hours:

      INFO - Completed com.liferay.journal.verify.JournalServiceVerifyProcess#verifyArticleAssets in 20411095 ms
      

      When the query was changed to

       SELECT {JournalArticle.*} FROM JournalArticle WHERE JournalArticle.resourcePrimKey NOT IN ( SELECT DISTINCT ResourcePermission.primKeyId FROM ResourcePermission WHERE (ResourcePermission.name = 'com.liferay.journal.model.JournalArticle') AND (ResourcePermission.primKeyId = JournalArticle.resourcePrimKey) AND (ResourcePermission.scope = ?)	) 

      execution was faster 11 minutes.

      INFO - Completed com.liferay.journal.verify.JournalServiceVerifyProcess#verifyArticleAssets in 1265349 ms

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sampsa.sohlman Sampsa Sohlman (Inactive)
              Reporter:
              sampsa.sohlman Sampsa Sohlman (Inactive)
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 29 weeks, 1 day ago

                  Packages

                  Version Package
                  7.0.0 DXP FP23
                  7.0.X EE
                  7.0.4 CE GA5
                  7.1.X
                  Master