Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19158

limitation on Group in createPermissionCheckingSQL is very slow in sites with populated groups

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0
    • Fix Version/s: Customer request, 5.1
    • Component/s: Database related
    • Labels:
      None

      Description

      Fetching nodes with eZContentObjectTreeNode::subTreeByNodeID on a site with a policy with *Group (self )* takes a long time to execute when there is a large number of users within the user's group.

      The query resulting from createPermissionCheckingSQL could be enhanced to perform better in this scenario.

      Steps to reproduce
      • Create a large number of users within group //Members//
      • Create a policy that includes a test for *Group ( self )*
      • Create a view that executes eZContentObjectTreeNode::subTreeByNodeID so that you can call it from the admin interface logged in as a member
      • Check how much it takes for the fetch function to produce results.

        Issue Links

          Activity

          Hide
          Patrick Allaert added a comment - - edited
          Show
          Patrick Allaert added a comment - - edited Fixed in: eZ Publish master: https://github.com/ezsystems/ezpublish/commit/24bd6d8b3992236a4b5f47852cf335b28b8d50f0 + https://github.com/ezsystems/ezpublish/commit/f69b2fa442e4a1df23b58cd11c39cf6bef9ebede (to fix PostgreSQL / Oracle not supporting JOINs without condition)
          Hide
          Damien Pobel (eZ) added a comment -

          In reply to comment #057773
          Regression: this patch breaks the compatibility with PostgreSQL and Oracle because it replaces some "where join" with INNER JOIN without specifying on which column to join.

          Show
          Damien Pobel (eZ) added a comment - In reply to comment #057773 Regression: this patch breaks the compatibility with PostgreSQL and Oracle because it replaces some "where join" with INNER JOIN without specifying on which column to join.
          Hide
          Douglas Hammond added a comment -

          Possible fix by adding ON TRUE to the added INNER JOIN's ?

          Show
          Douglas Hammond added a comment - Possible fix by adding ON TRUE to the added INNER JOIN's ?
          Hide
          Patrick Allaert added a comment -

          In reply to comment #057776
          Not the best solution!
          In https://github.com/ezsystems/ezpublish/commit/f69b2fa442e4a1df23b58cd11c39cf6bef9ebede I managed to make joins more explicit by always using condition(s).
          This makes the intention of SQL queries much more explicit.

          Show
          Patrick Allaert added a comment - In reply to comment #057776 Not the best solution! In https://github.com/ezsystems/ezpublish/commit/f69b2fa442e4a1df23b58cd11c39cf6bef9ebede I managed to make joins more explicit by always using condition(s). This makes the intention of SQL queries much more explicit.
          Hide
          Douglas Hammond added a comment -

          In reply to comment #057777
          I have tried your changes and so far so good. thanks

          Show
          Douglas Hammond added a comment - In reply to comment #057777 I have tried your changes and so far so good. thanks

            People

            • Assignee:
              Unassigned
              Reporter:
              J. J. Cavalleri
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 7 hours, 55 minutes
                2d 7h 55m