Guys, I am really struggling at my prisma server. ...
# orm-help
p
Guys, I am really struggling at my prisma server. I have migrated lately from 1.34 to 3.1 and my queries extremly slowed down compared to the previous version. I have tested at local development for a dataset of 1000 records. And debugged the resolver, and the resolver provides the dataset under 1 second, and returns it from the function. But then at the client side its pending ( at the network tab) for about 27 sec more. I have tested at the playground also with a similar query as the client has, but there is the same amount of 27 sec waiting until the data provided. It should not network related since the resolver provide the dataset quite fast, under 1 sec. And it has also not client related since playground also suffer from this long wait time to display the result, after the data resolved. I am using apollo-server-express “^3.5.0” and “nexus”: “^1.1.0”, “@prisma/client”: “^3.10.0”, I really does not have any idea where to go from here. Advices appreciated. Many thanks UPDATE Probably It caused by the nested queries, since i just tested the main query return time! But still it is a significant performance loss compared to v1.34, which resulted the final result approx 8-10x faster for the same query. Is it possible to debug the nested calls?
c
I have a feeling one of the drawbacks of Prisma is that it is not optimized for performance, although I'd be happy to be corrected if anyone knows better. Meaning, joins are done by JS at the Prisma Client level, rather than via SQL joins, which is going to get exponentially slower compared to SQL joins as your dataset grows. This observation is based on looking at a very limited number of generated SQL queries, so I'm curious if I'm right.
n
Hey @Peter Takacs 👋 really sorry for the delay! Were you able to figure things out in the meantime? Generally, the best course of action in these cases probably is to create a GitHub issue since our engineers are always eager to debug performance problems! Also, @Chris Tsongas, you’re definitely raising an interesting point there. I actually just responded to the same question here on Slack, hopefully my answer brings some insight about how we’re thinking about optimizing queries 🙏 https://prisma.slack.com/archives/CA491RJH0/p1646982182446919?thread_ts=1646799638.123979&cid=CA491RJH0
🙌 1