A code optimizer is used to optimize a computer program that references a
database by determining the characteristics of the database and making
suitable optimizations based on the characteristics of the database. By
taking into account the characteristics of a database referenced in the
computer program, the optimizer may make suitable optimizations to the
computer program. Such optimizations include, without limitation,
removing unnecessary calls to the database, removing unnecessary loops,
removing unnecessary database operations, providing compile-time errors,
and replacing dynamic calls with static data.