4 ms·
That seems weirdly convoluted. So you store two columns to represent the foreign key?
by aidos 3y ago
That seems weirdly convoluted. So you store two columns to represent the foreign key?
- unnouinceput 3y agoIf you use a varchar as FK then you're definitely doing something wrong from beginning. OP was talking about getting the phone number under certain conditions, and a phone number column is a varchar.
- aidos 3y agoI don’t think they ever did a lookup on phone number and even if you needed to, you would just index it and it’d be fast. You can even use things like tri-gram indexes to give you super fast partial phone number matching.