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

Fix huge amount of queries when unfolding the publication tree

    XMLWordPrintable

    Details

      Description

      Each time an entry in the publication tree is unfold, hundreds of queries are run to get the entry children.

      Logging the slow queries with a trigger at 1 ms is helpful to detect that too many queries are run, even if the cost of each query is small.

      All the queries look like this one

      [SessionImpl] duration_ms:	1.76	QueryFilter(principal=Administrator, limit=0, offset=0) 	query	SELECT * FROM Document WHERE ecm:parentId = '04191c91-bdd8-4381-8629-5d2c9ed1e427' AND ecm:currentLifeCycleState != 'deleted'AND ecm:mixinType IN ('PublishSpace') AND ecm:mixinType NOT IN ('HiddenInNavigation'){{RemoteAddr,10.213.3.23}{RequestURL,http://nereid2:8080/nuxeo/view_documents.faces}{ServletPath,/view_documents.faces}{SessionID,D6883E863AC45040899BAB7A5D68CB6C.nuxeo}{UserPrincipal,Administrator}}
      

      The problem seems related to the methods ProxyTree#getChildrenNodes and AbstractRemotableNode#getChildrenNodes (called from ProxyNode) which does not have a cache and which are called many times during the rendering of the JSF page.

      There may be other methods which need a cache, like AbstractRemotableNode#getChildrenDocuments

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days
                2d