Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21209

Delete filter is slow (seems to load all filters)

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      When deleting more than 2000 filters using the delete filter snippets (see https://snippets.xwiki.org/xwiki/bin/view/Extension/Notification%20filter%20preferences%20remover/ ) it seems very slow.
      It seems each delete is loading all filters before deleting the filter item to delete.
      See the following stack trace:

      at org.hibernate.loader.Loader.doList(Loader.java:2850)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682)
      at org.hibernate.loader.Loader.list(Loader.java:2677)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
      at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
      at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
      at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.lambda$execute$0(HqlQueryExecutor.java:172)
      at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor$$Lambda$985/0x000000084103f440.doInHibernate(Unknown Source)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:826)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:902)
      at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:169)
      at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
      at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:306)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.lambda$getPreferencesOfEntity$1(NotificationFilterPreferenceStore.java:202)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore$$Lambda$1451/0x0000000841367040.get(Unknown Source)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.configureContextWrapper(NotificationFilterPreferenceStore.java:442)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.getPreferencesOfEntity(NotificationFilterPreferenceStore.java:190)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.getPreferencesOfUser(NotificationFilterPreferenceStore.java:130)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.getFilterPreference(NotificationFilterPreferenceStore.java:92)
      at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.deleteFilterPreference(NotificationFilterPreferenceStore.java:221)
      at org.xwiki.notifications.filters.internal.DefaultModelBridge.deleteFilterPreference(DefaultModelBridge.java:139)
      at org.xwiki.notifications.filters.internal.CachedModelBridge.deleteFilterPreference(CachedModelBridge.java:153)
      at org.xwiki.notifications.filters.internal.UserProfileNotificationFilterPreferenceProvider.deleteFilterPreference(UserProfileNotificationFilterPreferenceProvider.java:80)

      There could be a better way to delete all filters, but it seems weird it is needed to load all filters to delete one. This is related also to the delete all filters task XWIKI-16591

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: