I'm experiencing some unusual slowness, but only when using Prisma on a local machine that is connecting to a remote RDS instance.
The strange thing is, if I run raw queries locally on the remote AWS RDS instance, it's much faster.
If I run my Postgres server locally, there is virtually no difference between writing raw queries and using Prisma.
There's something weird about the specific combination of using Prisma locally and connecting to a remote RDS instance. Here are some rough benchmarks doing a create:
I'm using a standard DB connection in my prisma.schema:
datasource db {
provider = "postgresql"
url = env("DB_URL")
}
I've debugged my connection / disconnection logic and nothing weird is going on there with like multiple connections / disconnections on query.
The only clue I have so far is that Prisma creates these transaction blocks with separate create and select statements and generally they are much more explicit and verbose than the raw queries I would write.