This article mainly describes how to correctly understand the DB2 partition compatibility and compare the basic data types of the columns corresponding to the partition key, and declare them as partition compatible ). Partition-compatible data types have the following attributes:
Two variables with the same value but different types are mapped to the same partition number according to the same partition algorithm.
Recently I have been reading some DB2 DPF things. I have two concepts that I don't understand.
This is the concept of "partition compatibility" and "Parallel.
I found some related materials, including the following:
Partition compatibility
You can compare the basic data types of the corresponding columns of the partition key, and declare them as partition compatible ). Partition-compatible data types have the following attributes: two variables with the same value but different types are mapped to the same partition number according to the same partition algorithm. DB2 partition compatibility has the following features:
The basic data type is compatible with another similar basic data type.
The internal format is used for DATE, TIME, and TIMESTAMP data types. They are not compatible with each other and are not compatible with CHAR.
Partition compatibility is NOT affected by columns defined with not null or for bit data.
Processing of NULL values of compatible data types is completely the same; processing of NULL values of incompatible data types may be different.
The basic data types of user-defined types are used to analyze DB2 partition compatibility.
The processing of decimal places with the same value in the partition key is exactly the same, even if their scale and precision are different.
Spaces at the end of a string (CHAR, varchar graphic, or VARGRAPHIC) are ignored by the hash algorithm.
BIGINT, SMALLINT, and INTEGER are compatible data types.
REAL and FLOAT are compatible data types.
CHAR and VARCHAR of different lengths are compatible data types.
GRAPHIC and VARGRAPHIC are compatible data types.
Partition compatibility is not applicable to long varchar, long vargraphic, CLOB, DBCLOB, and BLOB data types because they cannot be used as partition keys.
The above content is a description of the correct understanding of DB2 partition compatibility, hoping to help you in this regard.