Resolving AEM publish outages caused by inefficient AssetShare queries

Adobe Experience Manager (AEM) Publish environments may become unavailable when inefficient AssetShare queries use redundant UNION branches and broad predicates, causing expensive repository traversals that can exceed Oak safety limits. To resolve the issue, simplify and limit the queries, make the predicates more selective, verify index coverage, and update the custom index if required.

Description description

Environment

  • Adobe Experience Manager (AEM), all supported versions
  • AEM as a Cloud Service and on-premise deployments

Issue/Symptoms

  • Publish environments become unavailable or unresponsive.
  • Error logs and monitoring tools report Query Without Index Detected alerts.
  • AssetShare search queries perform UNION searches across multiple DAM paths.
  • Queries filter dam:Asset nodes where a property such as jcr:content/contentFragment is null and sort by a metadata property.
  • Duplicate UNION branches increase query cost.
  • Under normal or burst traffic, concurrent requests cause the repository to traverse tens of thousands of nodes per request, sometimes reaching the Oak safety limit, for example, 100,000 nodes, which can result in forced query termination and outages.

Root cause

Inefficient AssetShare search queries with redundant UNION branches and broad predicates, such as filtering primarily on a null property, cause expensive repository traversals. Even when a custom index exists, the query structure can exceed Oak safety limits and cause Publish outages.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review and refactor the AssetShare query structure:

    • Remove duplicate UNION branches so that each DAM path appears only once per query.
    • Avoid repeating the same DAM paths.
  2. Add query result limits. Use a limit clause to restrict the number of results returned and reduce repository load and excessive traversal.

  3. Make the query more selective. Refine the predicates to use specific metadata or property values instead of relying primarily on a property being null.

  4. Validate index coverage:

    • Use the Query Performance tool and explain plans to confirm that the custom index for asset queries is selected for the optimized query.
    • Ensure that the index supports null checks for the relevant property and sorting by the required metadata field.
  5. If an outage is ongoing, temporarily disable or throttle the affected AssetShare components or pages at the Dispatcher or CDN layer to reduce the impact on Publish while correcting the query.

  6. If index changes are required:

    • Extend or create a custom index to support the required predicates and sort order if the query can’t be made sufficiently selective.
    • For AEM as a Cloud Service, deploy the index changes through the Cloud Manager pipeline according to the standard process.
  7. After making the changes, monitor the Publish environment for stability and confirm that Query Without Index Detected alerts no longer occur.

recommendation-more-help
experience-cloud-kcs-help-kbarticles