【问题标题】:Are there any performance issues in using composite-ids with Hibernate?在 Hibernate 中使用复合 ID 是否存在任何性能问题?
【发布时间】:2011-12-17 17:44:28
【问题描述】:

是否有人知道在 Hibernate 中使用复合 ID(无论是 @EmbeddedId 还是 @IdClass)时存在任何性能问题?

谢谢。

【问题讨论】:

    标签: performance hibernate composite-key composite-primary-key


    【解决方案1】:

    在我看来,Hibernate 本身无论是否是复合键都不会对性能产生重大影响。重要的是 dbms、引擎类型、查询、表更新次数、索引和列类型。 Hibernate 只是将 hql 转换为 sql,因此在这种情况下,如果底层查询执行良好,则 hibernate 的性能应该很好......

    这里是一个链接,就 MySQL 而言,这里有关于这个问题的很好的解释

    Composite Primary Key performance drawback in MySQL

    【讨论】:

      猜你喜欢
      • 2012-02-14
      • 1970-01-01
      • 1970-01-01
      • 2021-06-10
      • 2011-01-19
      • 1970-01-01
      • 2017-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多