简体   繁体   English

使用SQL Server扩展属性的性能注意事项

[英]Performance Considerations for using SQL Server Extended Properties

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. 注意:这是一个SQL Server 2005数据库。

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. 这种影响取决于属性的读取和设置方式,以及属性的大小和数量。

They are simply text properties: not considered in plans, compiling, statistics, anything. 它们只是文本属性:在计划,编译,统计信息等中均未考虑。

Unless you do some painful/fancy "SELECT * FROM sys.extended_properties " stuff... 除非您做一些痛苦/花哨的“ SELECT * FROM sys.extended_properties ”之类的东西...

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) 它们对于文档化文档以及向数据库对象添加注释也非常有用:尤其是与Red Gate SQL Doc等第三方工具(可能是其他工具)结合使用时

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. 仅供参考:我注意到,当更改UDF以删除架构绑定然后重新添加架构绑定时,扩展属性在UDF上消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM