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.
有没有人知道在使用复合 ID 时有任何性能问题,无论是Hibernate@EmbeddedId还是?@IdClass
@EmbeddedId
@IdClass
谢谢。
在我看来,Hibernate 本身无论是否是复合键都不会对性能产生重大影响。重要的是 dbms、引擎类型、查询、表更新次数、索引和列类型。Hibernate 只会将 hql 转换为 sql,因此在这种情况下,如果底层查询执行良好,hibernate 的性能应该很好......
这是一个链接,就MySQL而言,这里有关于这个问题的很好的解释
MySQL 中的复合主键性能缺陷