Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我代理键(数字或varchar2)的最佳数据类型是什么?我读过代理键最适合数字类型。但是性能是否严重与数据类型有重大影响。它也依赖于数据库吗?
将不胜感激!
在我能想象的任何数据库中,数字数据类型都将比 varchar 更快——考虑比较的行为——但你必须做任何适合你情况的事情。如果 varchar 有意义,那就去吧。如果其中任何一个都适合您,请坚持使用数字。