Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate slow query #107

Closed
jcoyne opened this issue Aug 10, 2023 · 1 comment
Closed

Investigate slow query #107

jcoyne opened this issue Aug 10, 2023 · 1 comment

Comments

@jcoyne
Copy link
Contributor

jcoyne commented Aug 10, 2023

In sul-requests we run this query and it takes about 30 seconds in the folio-dev environment:

         query InstanceByHrid {
            instances(hrid: "L284") {
              id
              title
              identifiers {
                value
                identifierTypeObject {
                  name
                }
              }
              instanceType {
                name
              }
              contributors {
                name
                primary
              }
              publication {
                dateOfPublication
              }
              electronicAccess {
                materialsSpecification
                uri
              }
              items {
                barcode
                status {
                  name
                }
                dueDate
                materialType {
                  id
                  name
                }
                chronology
                enumeration
                effectiveCallNumberComponents {
                  callNumber
                }
                notes {
                  note
                  itemNoteType {
                    name
                  }
                }
                effectiveLocation {
                  id
                  campusId
                  libraryId
                  institutionId
                  code
                  discoveryDisplayName
                  name
                  servicePoints {
                    id
                    code
                    pickupLocation
                  }
                  library {
                    id
                    code
                  }
                  campus {
                    id
                    code
                  }
                  details {
                    pageAeonSite
                    pageMediationGroupKey
                    pageServicePoints {
                      id
                      code
                      name
                    }
                    scanServicePointCode
                    availabilityClass
                  }
                }
                permanentLocation {
                  id
                  code
                  details {
                    pagingSchedule
                  }
                }
                permanentLoanTypeId
                temporaryLoanTypeId
                holdingsRecord {
                  effectiveLocation {
                    code
                  }
                }
              }
            }
          }

Which parts are particularly slow? Is there any way to optimize?

This was originally part of sul-dlss/sul-requests#1676

@jcoyne
Copy link
Contributor Author

jcoyne commented Aug 10, 2023

It's dueDate that's taking about 15s
holdingRecords are good for another 4s.
effectiveLocation is another 5s.
permanentLocation is another 3s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant