性能问题是否随着变更集的增加而发生?

Does performance issues occur with increase in changesets?

我的公司使用 liquibase 来跟踪数据库更改。每天都会添加大约 100 个新的变更集。据我了解,对于已经执行的变更集,liquibase 再次计算校验和并将其与 databasechangelog table 中的校验和进行比较,以查看校验和是否已更改并在更改时给出校验和问题。

所以几个月后,当我已经执行了大量的变更集时,如果我添加一个新的变更集,这个计算已经执行的变更集的校验和并比较它们的过程不会使新变更集的执行变慢或导致任何性能相关问题?

我从来没有遇到过 liquibase 的这种性能问题。

但我猜你的问题引发了更多问题:

  • 你认为 "slower" 是什么?
  • 什么时候性能开始成为一个问题,这真的是一个问题吗?
  • 也许您的应用程序架构有问题?

无论如何,将校验和与 DATABASECHANGELOG table 进行比较不会花费很多时间 - 如果您有很多很多的变更集,可能只需几秒钟。

根据 liquibase 文档:

Other times, the problem is that liquibase update is taking too long. Liquibase tries to be as efficient as possible when comparing the contents of the DATBASECHANGELOG table with the current changelog file and even if there are thousands of already ran changeSets, an “update” command should take just seconds to run.

但是如果这几秒钟真的出了问题,那么请考虑阅读这篇文章: Trimming ChangeLog Files