4 ms·
That's a good idea but doesn't it need 2 round trips if you use an auto-increment primary key? First insert and then update by hashing the new id.
by xaferel 4y ago
That's a good idea but doesn't it need 2 round trips if you use an auto-increment primary key? First insert and then update by hashing the new id.
- grncdr 4y agoNot the poster you’re replying to, but with this approach you generally don’t store the hashed identifier. Just encode/decode at the application boundaries.
- Too 4y agoHow do you decode a hash?
- grncdr 4y agoah sorry, I was not very precise about "hashed". What I meant (and have done in the past) is to encrypt/decrypt the auto-incrementing ID at the application boundaries. If the OP is really using a one-way hash then yes, you would have to store both IDs.