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

      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:
                  6 years, 43 weeks, 5 days ago

                  Packages

                  Version Package
                  6.1.30 EE GA3
                  6.2.0 CE M4