“访问检查缓存”服务器配置选项access check cache Server Configuration Options

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

通过 SQL ServerSQL Server访问数据库对象时,访问检查缓存在一个名为 访问检查结果缓存的内部结构中。When database objects are accessed by SQL ServerSQL Server, the access check is cached in an internal structure called the access check result cache.

“访问检查缓存桶计数”选项控制用于访问检查结果缓存的哈希桶的数目。The access check cache bucket count option controls the number of hash buckets that are used for the access check result cache.

“访问检查缓存配额”选项控制访问检查结果缓存中存储的条目数。The access check cache quota option controls the number of entries that are stored in the access check result cache. 如果达到最大条目数,则从访问检查结果缓存中删除最早的条目。When the maximum number of entries is reached, the oldest entries are removed from the access check result cache.

默认值 0 表示 SQL ServerSQL Server 正在管理这些选项。The default values of 0 indicates that SQL ServerSQL Server is managing these options. SQL Server 2016 (13.x)SQL Server 2016 (13.x) 开始,默认值将转换为以下内部配置:Starting with SQL Server 2016 (13.x)SQL Server 2016 (13.x), the default values translate to the following internal configurations:

  • 对于访问检查缓存桶计数,值 0 将设置为默认值(即 256 个桶)。For access check cache bucket count, the value 0 sets a default value of 256 buckets.
  • 对于访问检查缓存配额,值 0 将设置为默认值(即 1,024 个条目)。For access check cache quota, the value 0 sets a default value of 1,024 entries.

在极少数情况下,可以通过更改这些选项来提高性能。In rare circumstances, performance can be improved by changing these options. 例如,如果使用了太多内存,则可能希望减小访问检查结果缓存的大小。For example, you may want to reduce the size of the access check result cache if too much memory is used. 或者,如果在重新计算权限时 CPU 使用率较高,则可能希望增加访问检查结果缓存的大小。Or, you may want to increase the size of the access check result cache if you experience high CPU usage when permissions are recalculated.

重要

Microsoft 建议仅在有 Microsoft 客户支持服务部门提供指导的情况下才更改这些选项。Microsoft recommends only changing these options when directed by Microsoft Customer Support Services. 如果必须更改“访问检查缓存桶计数”和“访问检查缓存配额”的值,请使用 1:4 的比率。If you have to change the "access check cache bucket count" and "access check cache quota" values, use a ratio of 1:4. 例如,如果将“访问检查缓存桶计数”的值更改为 512,则应将“访问检查缓存配额”的值更改为 2,048。For example, if you change the "access check cache bucket count" value to 512, you should change the "access check cache quota" value to 2,048.

另请参阅See Also

服务器配置选项 (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)sp_configure (Transact-SQL)