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
warflash17mo 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
hachoter17mo 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.og17mo ago
What's more performant than native behaviour?
BREAD
BREAD17mo 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
hachoter17mo 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
BREAD17mo ago
Overhead will not be noticeable until your queries return huge amounts of data
marcus.og
marcus.og17mo 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