Slow queries and inserts with postgres

I'm trying out the t3 stack with a neon (I've also tried supabase) postgres database. In both local and prod I get latencies in the 600ms to several second range for very simple queries and inserts. This happens with both Prisma and Drizzle, and is IMO not caused by database location relative to me. I'm kind of at my wits end in terms of debugging. I noticed that cal.com (also using t3) get's queries down to the sub ms range. Does anyone have the faintest idea of what I could try in order to speed up my queries?
2 Replies
Neto
Neto2mo ago
when connecting directly, you get the same latency?
OliverJ
OliverJOP2mo ago
Thanks for the reply. No I don't. I'm using a serverless db so I still get a high latency (all things considered) but no where near the latency the stack applied, What I've ended up doing is just implementing the stack from scratch and it works with a decent latency now.
Want results from more Discord servers?
Add your server