mohlx
TTCTheo's Typesafe Cult
•Created by mohlx on 5/5/2023 in #questions
Why is the first query on each request so slow?
On each request in the Nextjs App Router is the first query extremly slow. I connect to the database as follows:
I also tried this in a simple nodejs project without next and there it's works. Does anyone have any idea why this is so?
3 replies
TTCTheo's Typesafe Cult
•Created by mohlx on 4/28/2023 in #questions
Why prisma do 2 seperate Queries instead of 1 left join?
Why does this query execute 2 seperate Queries like this:
I believe this should, to optimize performance, be send as a single query with a join.
I wrote a raw sql query that does the same thing:
On avarage the query that prisma generated is 7ms, and my query is 2ms.
Why does prisma not generate a sinqle query utilising a join?
4 replies
TTCTheo's Typesafe Cult
•Created by mohlx on 4/23/2023 in #questions
TRPC context in RSC
I wanted to use trpc in React server components. I found the approach with the createCaller() method. But there is one problem, for the auth I have to set the headers (cookies), but in the app router the cookies() and the headers() function is only read-only. Is there any good solution for this problem?
2 replies