AEM Headles GraphQL query slow | Community
Skip to main content
Level 2
July 11, 2023
Solved

AEM Headles GraphQL query slow

  • July 11, 2023
  • 2 replies
  • 665 views

version: 6.5.17.0

method: Content Fragment GraphQL APIs

Use different folders to differentiate languages, a total of 1452 records (En: 726 records, ZH-HK: 726 records).

Query:

query queryAllADOForms($lang: String!) {
adoFormsList(
_locale: $lang
) {
items {
_path
name
formName
formCode
formCategories
formPurpose
attachment {
... on DocumentRef {
_path
}
}
hiddenSearchableField {
plaintext
}
additionalViewersWhenPublished
expiryDate
lastModified
}
}
}

 

execute query:

Usually 10 seconds, sometimes longer.

 

Are there any ideas to improve the efficiency of the query?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

You can do the following:

1) Check the query is performant, make sure this has an index. 

2) Make sure this is being cached and check the performance against a cache layer

3) Analyze if you have the chance to use paging to reduce the initial result set

 

Check these recommendations which can help as well:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-api/graphql-optimization.html?lang=en

 

2 replies

aanchal-sikka
Community Advisor
Community Advisor
July 11, 2023

hello @darrendu 

 

If you are on AEM on-premise, please refer to latest release notes. It suggests to install a graphql index package for better performance

 

https://experienceleague.adobe.com/docs/experience-manager-65/release-notes/release-notes.html?lang=en#install-aem-graphql-index-add-on-package 

 

Once this is done, please check for the logs for any traversal messages,while executing GraphQL queries. If any custom property, ordering etc is used, please consider optimizing indexes.

Aanchal Sikka
EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 11, 2023

You can do the following:

1) Check the query is performant, make sure this has an index. 

2) Make sure this is being cached and check the performance against a cache layer

3) Analyze if you have the chance to use paging to reduce the initial result set

 

Check these recommendations which can help as well:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-api/graphql-optimization.html?lang=en

 

Esteban Bustamante