Since 4 is compromised we're shipping drizzle rc5
▪︎ FINALLY incremental snapshots -93% size and LoC
▪︎ Effect v4 types
▪︎ ORDER BY for relations in queries
▪︎ perf boost for complex relational queries
▪︎ [PREVIEW] drizzle postgres driver
▪︎ fixes and improvements
We will be dropping Drizzle Cache API in v1
Caching query responses in ORM is:
▪︎ wrong place
▪︎ easiest footgun
▪︎ nightmare for us, library maintainers
let me know if you use drizzle cache API, we will propose you a proper way
We will be dropping Drizzle Cache API in v1
Caching query responses in ORM is:
▪︎ wrong place
▪︎ easiest footgun
▪︎ nightmare for us, library maintainers
let me know if you use drizzle cache API, we will propose you a proper way
How to make Postgres inserts not suck?
2 things:
▪︎ binary representation of a DEFAULT 🙃
▪︎ insert statement prepared without its rows 🙃
every cell value has header on insert
▪︎ >=0 means that many bytes follow
▪︎ -1 is NULL
▪︎ -2 vacant, lets make DEFAULT
voila:
How we make it suck less now?
We built a postgres driver from scratch, we open a transaction an pipeline statements with N number of params autotune based on columns count, we autoname statemts if we see them more than once, which allows db to not reparse them. And we make sure we neither waste local memory, nor on db! All so you can just:
Inserting with VALUES has every feature, but the rows are in the statement text.
You can't pass an arbitrary number of rows. Every cell is a parameter, and a statement holds at most 65,535 of them. With 20 columns that is 3,276 rows. So the client cannot hand the server "these rows": it has to cut them into statements in a loop so that none goes out of bounds, wrap the loop in a transaction so the batch still succeeds or fails as a whole, and stitch the results of the statements back together. That is bulk insert implemented on the client, on top of a statement that was never bulk
Postgres inserts suck
Good news are:
▪︎ we made them suck less
▪︎ we know how to make them not suck
So, why they suck. This is how you insert multiple values in postgres...
there's so much bells and whistles for us to optimise around prepared named statements with databases to eliminate reparse overhead on the database server side which we can completely eliminate by sending already parsed statements in binary?