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

Rewrite query from Advanced Permission Checker to improve performance

    Details

    • Type: Feature Request
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Performance
    • Labels:
      None

      Description

      Currently it seems that: com.liferay.portal.service.persistence.findByC_C_N_D takes an extended period of time to complete as the system makes excessive physical reads which can be avoided. It would be helfpul if the call originating from AdvancedPermissionChecker could be rewritten using this query as an example:

      SELECT group_.groupid AS groupId,
      group_.name AS groupName,
      group_.type_ AS groupType,
      group_.friendlyurl AS groupFriendlyURL
      FROM group_
      WHERE ( group_.livegroupid = 0 )
      AND ( group_.companyid = '20002' )
      AND ( group_.classnameid = 10001
      OR group_.classnameid = 10003 )
      AND ( group_.name != 'Control Panel' )
      AND ( Lower(group_.name) LIKE NULL
      OR Lower(group_.name) LIKE NULL
      OR NULL IS NULL )
      AND ( Lower(group_.description) LIKE NULL
      OR NULL IS NULL )
      AND ( group_.type_ != 4 )
      AND ( EXISTS ( SELECT 1 FROM users_groups
      WHERE users_groups.groupid = group_.groupid
      AND ( users_groups.userid = '51182697' )
      )
      OR EXISTS (SELECT 1 FROM users_orgs
      WHERE ( users_orgs.organizationid = group_.classpk )
      AND ( users_orgs.userid = '51182697' )
      )
      OR EXISTS ( SELECT 1 FROM groups_orgs, users_orgs
      WHERE ( groups_orgs.groupid = group_.groupid )
      AND ( users_orgs.organizationid = groups_orgs.organizationid )
      AND ( users_orgs.userid = '51182697' )

      )
      OR EXISTS ( SELECT 1 FROM groups_usergroups, users_usergroups
      WHERE ( groups_usergroups.groupid = group_.groupid )
      AND ( users_usergroups.usergroupid = groups_usergroups.usergroupid )
      AND ( users_usergroups.userid = '51182697' )
      )
      )

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              ira.chui Ira Chui
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package