#rawQuery compilation

13 messages · Page 1 of 1 (latest)

karmic ember
#

After switching from mssql to Prisma ORM, I noticed that the rawQuery calls are much slower than they were on mssql. Do they get precompiled and cached and if not, is there any way to? I have a pretty big query that takes about 520ms to complete while it used to be about 20ms.

I also cannot use TypedSQL as I'm using SQL Server as database.

bronze tiger
#

Rawquery in prisma means its raw like your mssql

#

maybe try drizzle?

karmic ember
#

With mssql I used prepared statements which did speed it up quite a bit. Figured that's because of some kind of compilation which Prisma may not be doing or doing every time it's executed.

karmic ember
bronze tiger
#

idk

karmic ember
#

Also doesn't seem to have MS SQL support actually, so that's not an option for me.

quick shoal
#

Hey @karmic ember 👋

There is some overhead involved even while using Raw Queries with Prisma as raw queries still need to be processed via the query engines, so at the moment it won't be as fast as a native mssql driver. We are working on a new prototype which should make queries alot faster. I don't have a timeline yet which I can share with you.

karmic ember
#

Or does TypedSQL already work differently?

quick shoal
#

Yes! The prototype is still being developed, but I am pretty sure it will be compatible with TypedSQL