99
you are viewing a single comment's thread
view the rest of the comments
[-] magic_lobster_party@kbin.run 6 points 4 months ago

This is tied to YAGNI. Do you really need to impose this restriction on this database? Don’t add restrictions “just in case it might be useful”. If you don’t have a good reason, you ain’t gonna need it.

[-] Kissaki@programming.dev 1 points 4 months ago

Are you saying "don't use a synthetic key, you ain't gonna need it"?

[-] Corbin@programming.dev 4 points 4 months ago

I think they're saying that e.g. you shouldn't index a natural key unless you know that you're going to search/collate by that key as a column. Telling the database that a certain column contains (a component of) the primary key is adding a restriction to that column.

this post was submitted on 20 Jun 2024
99 points (94.6% liked)

Programming

17314 readers
25 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS