concept space in category sql

This is an excerpt from Manning's book SQL Server DMVs in Action: Better Queries with Dynamic Management Views.
Fill factor describes how full an index page is. When you’re retrieving data, you want each page to have as much data on it as possible. This will allow you to fulfill a query’s needs with minimum reads, less locking, and less CPU usage. Similarly, when you’re identifying a group of rows that are to be subsequently updated, you want to be able to obtain as much data as possible per read operation. But when you need to insert data, which needs to be placed in sequence with related data, the index page should contain space for this. When there’s no space in the index page, page splitting will occur, resulting in queries taking longer because lookups need to be performed.
Here we’ll examine and discuss the importance of tempdb, see how to determine the amount of total and free space it has, and drill down into the amount of space used by the different types of objects it contains.
The script I use to find the amount of space (total, used, and free) in tempdb is shown in this listing.
Listing 9.1. Amount of space (total, used, and free) in tempdb
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT SUM(user_object_reserved_page_count + internal_object_reserved__page_count + version_store_reserved__page_count + mixed_extent_page_count + unallocated_extent_page_count) * (8.0/1024.0) AS [TotalSizeOfTempDB(MB)] , SUM(user_object_reserved__page_count + internal_object_reserved__page_count + version_store_reserved_page_count + mixed_extent_page_count) * (8.0/1024.0) AS [UsedSpace (MB)] , SUM(unallocated_extent_page_count * (8.0/1024.0)) AS [FreeSpace (MB)] FROM sys.dm_db_file_space_usage

This is an excerpt from Manning's book SQL Server MVP Deep Dives.
This isn’t to say that I always enforce this sort of constraint, as sometimes allowing an empty string is a good thing, because it allows you to differentiate between no value and a NULL value. But, when a column value is required, it’s usually not the best plan of attack to allow the user to enter a single space character in lieu of a “real” value. And for unique indexing purposes, I really don’t want strings containing different numbers of spaces to be treated as different values; users sometimes use this technique to get around putting in reasonable data values (though you can’t stop them from putting in gibberish for values, at least not easily).
The query in listing 3 returns a single row of data with four columns—the allocation unit type, the page count, the average page space used as a percentage, and the total number of rows in the dbo.Test table. The alloc_unit_type_desc column describes the allocation unit type: valid values are IN_ROW_DATA, LOB_DATA, or ROW_OVERFLOW_DATA (see Books Online for a detailed explanation of these terms). The page_count column indicates the total number of data pages used by the table for IN_ROW_DATA (that is, the allocation unit that stores the table rows in our example). The avg_page_space_used_in_percent column reports the average percentage of space used in all data pages in the IN_ROW_DATA allocation type. The record_count intuitively contains the number of rows contained in the table.
To continue with the example, let’s delete half of the rows in our dbo.Test table and see what happens to the space used by the table. The T-SQL script in listing 4 uses the modulo operator, represented by the percent sign in T-SQL, to delete each row where the value in the first column, col1, is an odd number. So we are deleting every other row in the table.
To prove that the space is truly available for reuse, let’s add another 3,000 rows to the table by altering and running listing 9.