Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-3872

Default USER_WORKSPACES querymodel generates a very expensive query

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2 GA
    • Fix Version/s: 5.3 RC
    • Component/s: Query & PageProvider

      Description

      At the sql level the list of user's workspaces is
      SELECT DISTINCT _nxhier.id, dublincore.title
      FROM hierarchy _nxhier
      LEFT JOIN proxies ON proxies.id = _nxhier.id
      JOIN hierarchy ON (hierarchy.id = _nxhier.id OR hierarchy.id = proxies.targetid)
      LEFT JOIN dublincore ON hierarchy.id = dublincore.id
      LEFT JOIN misc ON hierarchy.id = misc.id
      WHERE
      hierarchy.primarytype IN ('Workspace')
      AND (misc.lifecyclestate <> 'deleted')
      AND (NOT (NX_IN_TREE(_nxhier.id, '7bdcedfe-3b42-4676-a823-c818396bef58')))
      AND NX_ACCESS_ALLOWED(_nxhier.id, '

      {members,user5,Everyone}

      ',
      '

      {Browse,Read,ReadProperties,ReadRemove,ReadWrite,Everything}

      ')
      ORDER BY dublincore.title;

      The join on proxies is useless and very costly when there are many documents.

        Attachments

          Activity

            People

            • Assignee:
              bdelbosc Benoit Delbosc
              Reporter:
              bdelbosc Benoit Delbosc
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified