INF: Sizing Considerations for SQL DatabasesID: Q68231
|
Listed below is information on sizing considerations for databases.
Row length = 7 bytes + (data length) + (#var or null fields)where:
data length = is the sum of the column lengths.
#var or null fields = 1 byte is counted for every data element
defined as varchar or able to accept
null values.
Consider the following table definition:
first_element char(2) null,
second_element varchar(10),
third_element char(3),
fourth_element varchar(20) null
row length = 7 + (35) + (3)
row length = 45
NOTE: When the datatype varchar is defined to accept NULLs, only
1 byte is counted for this condition.
pages = [number of rows] / (2016/(row length))For example,
(800000 rows) / (2016/(100 bytes per row)) = ~40000 pages-or-
(800000 rows) * ((100 bytes per row)/2016)= ~40000 pages
row length = 8 + (data length) + (#var or null fields)The overhead per non-clustered index row is roughly 12 bytes plus the number of variable-length/nulls-allowed fields per row. The formula is defined as:
row length = 12 + (data length) + (#var or null fields)The number of pages in an index depends on how many index rows fit in a page, and this is determined the same way as for data. The formula is defined as:
pages = [number of rows] / (2016/(row length))
For example,
(800000 rows) / (2016/(100 bytes per row)) = ~40000 pages
-or-
pages = [number of rows] * ((row length)/2016)
For example,
(800000 rows) * ((100 bytes per row)/2016)= ~40000 pages
Please keep in mind that these formulas will give you a rough
estimate on space required for your database.
Additional query words: 4.20
Keywords : kbother SSrvAdmin SSrvGen
Version : 4.2 4.21 4.21a
Platform : OS/2 WINDOWS
Issue type :
Last Reviewed: March 10, 1999