logoalt Hacker News

WilcoKruijeryesterday at 9:18 PM1 replyview on HN

I really believe that every engineer writing queries (even SQL) should read the FoundationDB data modeling guide [0]. It really gives an appreciation of what smart choice of primary key can do to query efficiency. With some de-normalization, joins aren’t even needed for performance.

Postgres has supported query pipelining for a long time. In my opinion, most queries should be written in such a way that sequential queries don’t have any data dependencies on the previous query at all. This speeds up applications by huge amounts.

[0] https://apple.github.io/foundationdb/data-modeling.html


Replies

NorthSouthNorthyesterday at 10:06 PM

lol I remember a senior dev absolutely shitting on me for suggesting de-normalization to improve a JOIN query that was absolutely way too slow (on a table that was reseeded on deploys at that). I left it at that but to this day I maintain that it was the right move.