Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Very slow graphql query

Avatar

Level 1

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.

2 Replies

Avatar

Level 1

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.