#Extremely slow queries
21 messages · Page 1 of 1 (latest)
Hi
This can be due to a lot of reasons, including database location, type of query you're doing and so on.
i have both the server and the DB in east US and both hosted by render
supabase takes the same time
i'm also queying all products which is just 1 prod
i have another app in next 14 and using prisma+postgres+supabase takes around 2-3 sec to the getAll type of queries
If you did a simple migration from mongo to postgres, it makes sense it will take this amount of time. If you did some changes, then it is not normal
No, i mean Mongo and Postgres (or sql in general) databases are way different and so something optimized for one will not be the same for the other one
To delete a prod from the cart:
it takes around 3-4 secs to delete it
i didn't have any optimization for mongo, just as it looks in the pic too
so i noticed something strange, when i switched from nosql to sql and generated the zod types for the first time(a prisma generator), but specially, the trpc "inputTypes"
the server started fast, as usual, but, the 2nd time i started it, it took really long and didn't fix it self or something from now it always takes like 20 sec to start if i create those types, so i stopped creating them. I suspect I have some sort of bug, it can't take so long to query
my prisma schema is 260 lines long
Well, i'm not sure. If your database is huge, it can explain the time
just 2 prods
i mean the size of your database, not the amount xD
@olive ruin https://www.npmjs.com/package/prisma-sql maybe this can help?