hi! I have the following query: ``` query Test { ...
# orm-help
m
hi! I have the following query:
Copy code
query Test {
  business(where: { id: "93f13" }) {
    publicationBatches {
      publications(first: 1) {
        id
        localeCode
        paged {
          id
          pages {
            pageNumber
            image {
              url(width: 700)
            }
          }
        }
      }
    }
  }
}
what essentially happens is: 1) fetch business 2) fetch publication batches (there's 3) 3) fetch publications for publication batches (there's 1 for each) 4) fetch pages for each publication (there's around 100 for each) 5) fetch image for each page that's at least 600 objects that need to be fetched and it takes 5-10s with the above query. I was under the impression that Prisma had an efficient dataloader but I can't launch with these response times. what can I do to improve loading times?
d
What is the size of the response? Can you please check in chrome network tab how much time of the 5-6s is actually to move the data over the network?
m
it's all waiting for prisma, unfortunately
if I keep running the query I can sometimes squeeze it down to 4.8s but it doesn't seem like the cache is even working
d
Thanks! A few more questions. 1. Is this request on your application server or Prisma directly? 2. How much data do you have in the database?
m
this is locally using Docker using the Playground on localhost. I don't really have any data. maybe around 5000 objects
locally at least. in production I'll have millions of objects
d
Is this also slow locally? Can you please share a minimal reproduction as an issue then? with some sample (maybe fake) data? https://github.com/prisma/prisma/issues/new?template=bug_report.md
m
I've only tested it locally, which is where it's slow
d
Sure, a reproduction with similar amount of data / data structure would be great. Too many moving parts otherwise like the application server etc!
m
will do. there might be an issue with Docker or something like that. because it just took 70 s to run
prisma deploy
after making a small change
👍 1
d
Could be!
m
thx for your help
@divyendu an update: it's an issue related to Docker for Mac. I restarted Docker and now responses are around 400 ms
and I had to add
127.0.0.1 localunixsocket.local
to /etc/hosts
d
Awesome, thanks for notifying 🙂
m