7 ms·
Great article. Side note: his normalization example reminded me how I used to design tables using a numeric primary key thinking they were more performant than
by tmpfile 3y ago
Great article. Side note: his normalization example reminded me how I used to design tables using a numeric primary key thinking they were more performant than strings. But then I’d have a meaningless id which required a join to get the unique value I actually wanted. One day I realized I could use the same unique key in both tables and save a join.
Simple realization. Big payoff
- roselan 3y agoI still like to have a unique id field per table. It helps logging and it doesn't care about multi fields "real" key. However I keep an unique index on the string value and more importantly point integrity constraints to it, mainly for readability. It's way easier to read a table full of meaningful strings rather than full of numerical id or uuids.