Open dvnrsn opened 5 months ago
That's quite a discrepancy! 😅
Are you able to confirm in the subrequest profiler what the duration is?
I wonder if it has something to do with hashing the query key 🤔 That's quite a long wait though.
Could you also provide the full query you're sending once all the fragments are resolved?
We have one query that takes over 3 minutes once moving to loadQuery. With sanityclient.fetch it's 2 seconds.
I'm working on optimizing all our queries and yes I can get by using sanityClient here but I'm not sure why there is such a significant difference between the two.
What is different about this particular query (from our others)? It is probably a somewhat complicated nested fragment that looks like:
This is not the only place of complexity but it's certainly the source of delay (i.e., when I delete this groq fragment the query is fast again.
How I got the original logs: