Very slow graphql query | Community
Skip to main content
June 24, 2022

Very slow graphql query

  • June 24, 2022
  • 1 reply
  • 972 views

I have a total of 2400 content fragments of the same searched type, only four matches exactly what the query is looking for. At the end of execution, the result returning is correct, but the elapsed time reaches 10 seconds. if I run a JCR SQL_2 query that returns the same results, the elapsed time is 100ms.

 

I've tried indexing, installed the index package for graphql: cfm-graphql-index-def-1.0.5.zip, so far nothing has worked. The log does not show any errors or warns.

 

Query

query getLinkByPagePathType($_path: String!, $type: String) { linkList( filter: { pagePath: { _expressions: { value: $_path } } _logOp:AND LinkType: { _expressions: { value: $type, _operator:EQUALS } } } ) { items{ _path Label target ItemLink{ ... on LinkModel{ _path Label Description { html markdown plaintext json } } } ChannelLink{ ... on LinkModel{ _path Label Description { html markdown plaintext json } } } StaticFile{ ... on LinkModel{ _path Label Description { html markdown plaintext json } } } pagePath ExternalUrl NewWindow RELATED_TERMS visible LinkType DispOrder VCMID } } }

 Variables

{ "_path":"/content/my-project/Home/department-pages/technology", "type":"LINK" }

 

Any help will be appreciated, thank you all.

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

1 reply

kautuk_sahni
Community Manager
Community Manager
July 7, 2022
July 7, 2022

Hi kautuk_sahni,

I already created indexes for all the queries executed by graphql. In the log there is no WARN related to the number of nodes.