Varun Velamuri While testing this change a question came up. For this calculation:
For calculating frag_percent, please use the stats data_size_on_disk and log_space_on_disk. data_size_on_disk/log_space_on_disk should give the fragmentation percentage
I'm trying to understand the values used in the calculation...pardon if this elementary but I'm not familiar with index fragmentation. Would you please explain in layman's terms what are data_size_on_disk and log_space_on_disk. From the code review it says "DataSizeOnDisk is lss_data_size" but I'm not familiar with what lss_data_size is. What is log_space_on_disk?
From the web I see there's two types of index fragmentation:
1. Internal fragmentation occurs when data pages have excessive free space.
2. External fragmentation occurs when data pages are out of order.
which type of fragmentation is being calculated here?
Also, the Index Stats displayed by the UI include:
disk size: Total disk file size consumed by the index
data size: Actual data size consumed by the index
memory used: Total memory consumed by the index storage
On my macbook, these have values of 11MB, 11.6MB, and 21MB, respectively. Does this mean the "disk size" is the compressed size of the "data size"? And what are the reasons the "memory used" are much larger than the "data size"?
Thanks for the help in understanding this.