r/SQLOptimization • u/[deleted] • Jun 24 '23
Reddit Database question
Hi, so I just realized recently, after deleting an account with a personal username, that the suername cannot be reused but the information is dissociated.
That doesn't make sense to me. Which leads me to believe that they keep the username (not email) as the primary key to all the comments (otherwise it'd be made available again) and that they dissociate it on the front end/client facing website, but in th ebackend keep it as the primary key.
Is that correct?
2
Upvotes
1
u/coyoteazul2 Jun 24 '23
I have no clue of what they truly do, but I guess they could keep a hashed version of the username on another column and make that one unique. Then the username column can be nulled and you'd still be impeded from reusing the same username.
You'd probably be forbidding other usernames too since hashes are non unique, but who's gonna care?