Ancestors

Written by Kuba Suder • @mackuba.eu on 🦋 on 2024-12-03 at 15:29

If I was building a database that stores users' posts, follows etc., with the users having external 32-char identifiers, would it make more sense to have foreign keys for user IDs as integers everywhere, with a user table mapping int to ID, or to have the ID strings everywhere and do joins using strings? Would such string joins be slower? 🤔

[#]mysql #postgres #postgresql #sql

=> More informations about this toot | More toots from mackuba@martianbase.net

Toot

Written by Kuba Suder • @mackuba.eu on 🦋 on 2024-12-03 at 15:30

I'd assume that joins and lookups by long-ish strings would be slower than by ints, but maybe not, given that with a separate table mapping to ints I'd need to always do an extra lookup there?…

=> More informations about this toot | More toots from mackuba@martianbase.net

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113589605460059920
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
266.357821 milliseconds
Gemini-to-HTML Time
0.729978 milliseconds

This content has been proxied by September (3851b).