What's the overhead (if any) of using the new relational api?

I love the new relational api but I am wondering about the performance overhead
7 Replies
warflash
warflash2y ago
It still only sends one query to the database But naturally there will be overhead in most cases compared to manually written queries as auto generated ones can't be as refined
hachoter
hachoterOP2y ago
My main concern is that it's looping over the data to create the correct structure, this could quickly become a bottleneck, there is a reason prisma uses a rust binary
marcus.og
marcus.og2y ago
What's more performant than native behaviour?
BREAD
BREAD2y ago
It may depend on DBMS you are using, but in case of Planetscale(and probably any other MySQL but have to be clarified) the query generated by Relational API is not able to leverage indexes. Therefore reads are more expensive and potentially slower, but you will notice difference only with REALLY big tables
hachoter
hachoterOP2y ago
I think I didn't phrase my question right, my question was if drizzle manipulates the data in any way before returning it
BREAD
BREAD2y ago
Overhead will not be noticeable until your queries return huge amounts of data
marcus.og
marcus.og2y ago
No, i would treat drizzle as sql builder it just 1. builds only ONE query per function invocation (e.g select, insert) 2. maps stuff with ts types
Want results from more Discord servers?
Add your server