Local data type of a nickname column

Ensure that the local data type of a column does not prevent a predicate from being evaluated at the data source.

The default data type mappings are provided to avoid any possible overflow. However, a joining predicate between two columns of different data types or lengths will prevent the hash join technique from being considered by the optimizer. For the optimizer to consider the hash join, both the data types and lengths of the joining columns must match exactly. For example, Oracle data source columns that are designed to hold just integer values are often created as NUMBER within the Oracle database, which defaults to NUMBER (38). A nickname column for this Oracle data type is given the local data type FLOAT because the range of a Db2® integer is only roughly equal to NUMBER (9). In this case, joins between a Db2 integer column and an Oracle column that is defined as NUMBER (but only holding integer values) cannot use the hash join technique because the Oracle column is mapped as a FLOAT type. However, if the domain of this Oracle NUMBER column can be accommodated by the Db2 INTEGER data type, you can change its local data type with the ALTER NICKNAME statement. Then the optimizer can consider the hash join technique, which might improve performance.