使用 SQL Server 扩展属性的性能注意事项
致所有人,
我们希望使用扩展属性作为数据库文档的一部分。我的一位同事提到,在之前的项目中,他们使用了扩展属性,这影响了数据库性能。
我一直在互联网上搜索与此相关的任何证实信息。我还没有找到任何东西。
有人遇到过这种情况吗?如果是这样,是否有文章或链接可以让我阅读相关内容?
谢谢 - 杜先生
注意:这是一个 SQL Server 2005 数据库。
To All,
We are wanting to use Extended Properties as part of our database documentation. One of my co-workers mentioned that on a prior project they used Extended Properties and it impacted database performance.
I have been searching the internet for any corroborating information in regard to this. I've not found anything.
Has anyone encountered this? If so, is there an article or link where I can read up on this?
Thanks - Mr. Do
Note: this is a SQL Server 2005 database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的同事错了。如果使用扩展属性,则不会对正常数据库操作产生性能影响。
扩展属性的唯一影响是读取或写入扩展属性的操作。这种影响取决于读取和设置属性的方式以及属性的大小和数量。
Your colegue is wrong. There is no performance impact on normal database operations if you use extended properties.
The only impact extendet properties have is on operations that read or write extended properties. This impact depends on the way properties are read and set, and the size and number of properties.
它们只是文本属性:在计划、编译、统计等任何内容中都没有考虑。
除非你做了一些痛苦/奇特的“SELECT * FROM sys.extended_properties “东西...
它们对于记录数据库对象并向数据库对象添加注释也非常有用:特别是与诸如 Red Gate SQL 文档(可能是其他)
They are simply text properties: not considered in plans, compiling, statistics, anything.
Unless you do some painful/fancy "SELECT * FROM sys.extended_properties" stuff...
They are also very useful to document and add comments to the database objects: especially in conjunction with 3rd party tools like Red Gate SQL Doc (may be others)
我唯一看到的是,当我更新它们时,当特定进程运行时,我有时会受到对象上已有锁的影响,但性能并不是避免使用它们的理由。
仅供参考:我注意到,当更改 UDF 以删除架构绑定然后重新添加架构绑定时,UDF 上的扩展属性会消失。
The only thing I've seen is that when I am updating them, I am sometimes affected by locks already on the object when particular processes are running, but performance is not a reason to avoid using them.
FYI: I noticed that extended properties disappear on UDFs when a UDF is altered to remove schemabinding and then re-add schemabinding.