Your application program is the largest factor in determining the
efficiency of data access. However, there are some things you can do to
make it easier for a program to access the data. For example:
- When multiple data types can be used to represent the domain of a column,
use the most appropriate one (make each row as short as possible, thus
ensuring that the table occupies as few pages as possible).
- Use SMALLINT rather than INTEGER where appropriate.
- Use the DATE and TIME data types rather than CHAR.
- Use NOT NULL for columns wherever possible.
- Choose data types that can be processed most efficiently.
- Use CHAR rather than VARCHAR for any narrow columns (for example, those
that are less than 50 characters wide).
- Use FLOAT rather than DECIMAL for columns if exact precision is not
required.