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

com.liferay.portal.service.persistence.UserFinder.joinByNoOrganizations inefficient

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed

      Description

      The following code is very inefficient:

      <sql id="com.liferay.portal.service.persistence.UserFinder.joinByNoOrganizations">
      <![CDATA[
      WHERE
      (User_.userId NOT IN (
      SELECT
      userId
      FROM
      Users_Orgs
      ))
      ]]>
      </sql>

      Changing it to:

      <sql id="com.liferay.portal.service.persistence.UserFinder.joinByNoOrganizations">
      <![CDATA[
      WHERE
      (NOT EXISTS (
      SELECT
      userId
      FROM
      Users_Orgs
      WHERE
      User_.userId=Users_orgs.userId
      ))
      ]]>
      </sql>

      is much more performant

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 22 weeks, 2 days ago