Progress
Database Administration
Guide and Reference


Calculating Database Disk Requirements

The Version 9 database engine stores all database fields and indexes in variable-length format and does not store trailing blanks in character fields or leading zeros in numeric fields. The benefits of this variable-length storage technique are:

Table 2–1 lists the formulas you use to calculate the approximate amount of disk space (in bytes) required for a database.

Table 2–1: Formulas For Calculating Database Size
Size
Formula
Database size
schema size + data table size + index size
Schema size
Typically, between 1 and 100MB1
Data table size
Sum of individual table sizes
Individual table size
number of records x field storage x 1.5
Index size
Sum of individual index sizes
Individual index size
number of records in the table being indexed x
(7 + number of fields index +field storage)  x 2
  1. To determine the schema size, load the schema into an empty database and check the size of your database—this is the size of your schema.

Table 2–2 lists the formulas you use to calculate the field storage values (in bytes) for different data types.

Table 2–2: Formulas For Calculating Field Storage
4GL Data Type
(SQL-92 Equivalent)
Value
Field Storage In Bytes
CHARACTER
(VARCHAR)
1 + number of characters, excluding trailing blanks. If the number of characters is greater than 240, add 3 to the number of characters instead of 1.
DATE
(DATE)
3
DECIMAL
(DECIMAL or
NUMERIC)
Zero
1
Nonzero
2 + (number of significant digits + 1) / 2
INTEGER
(INTEGER)
Zero to 126
1
127 to 32,766
2
32,767 to 7.99 million
3
8 million to 1.99 billion
4
2 billion
5
LOGICAL
(BIT)
False
1
True
2

EXAMPLE

You want to calculate the estimated database size for a database with a single customer table. The table has three fields:

The table is indexed on just one field (Name) and you would expect to have about 500,000 records in the customer table. Table 2–3 lists formulas (and examples) for estimating the size of your database.

Table 2–3: Calculating Database Size
Database Component
Size
Schema
=  421,000 (This number is the size of an empty database with 
the schema loaded in.)
Field storage
= Cust-num + Name + Start-date
= 3 + 21 + 3 
= 27
Customer table
= number of records x field storage x 1.5
= 500,000 x 27 x  1.5 
= 20,250,000
Name index
= number of records x (7 + number of fields in index + index field storage ) x  2 = 500,000 x (7 + 1 + 21) x 2 = 29,000,000
Database
= schema size + data table size + index size
= 421,000 + 20,250,000 + 29,000,000 
= 49,671,000 bytes

These formulas are conservative since they often result in a large estimate of your database size. However, you also must allow for temporary disk space for each database user for the following purposes:

Database-related Size Criteria

When planning the size of your database, see "Progress Database Limits," for a description of the following database-related criteria:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095