MS SQL Server fill factor 面试题

https://www.hackerrank.com/challenges/indexes-3/problem

Consider the following two designs to store the data using clustered indexes in MS SQL Server:

  • In the first design, the fill factor is 20% and the total number of free rows per page are A.
  • In the second design, the fill factor is 40% and the total number of free rows per page are B.

the relation between A and B is :

In MS SQL Server, the fill factor determines the percentage of space on each page that is initially allocated to store data. A lower fill factor (e.g., 20%) leaves more space empty on each page, while a higher fill factor (e.g., 40%) allocates less empty space. The purpose of the fill factor is to allow for page splits and data growth without requiring frequent page adjustments, which can be costly in terms of auto performance.

The relationship between A and B can be calculated as follows:

if total number rows in design of A = total number rows in design of B,

A = 0.8x AND B = 0.6x

then

x = A/0.8 = B/0.6

A = (B / 0.6)*0.8

A = (0.8 / 0.6)* B

A = 1.33B

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务