4. Defining Data Types : dhmin Routine—Create Default Minimum Histogram Value
 
Share this page                  
dhmin Routine—Create Default Minimum Histogram Value
This routine creates the minimum default histogram value. You must place the address of this routine in the dtd_dhmin_addr field of the IIADD_DT_DFN structure. If the II_DT_NOHISTOGRAM attribute is present, then this routine is not necessary.
The default histogram values are used by the optimizer when no histogram data is present in the system catalogs. (Optimizedb, which creates statistics for use in histograms, cannot be run on user-defined data types.)
This routine differs from the hmin routine in that hmin provides the histogram for the smallest possible value, whereas dhmin provides the histogram for the smallest “usual” value.
No values are provided to this routine-you must determine what the minimum and maximum default values are. For example, if a data type is being used to store temperatures, a valid range is probably absolute 0 to some very high number. However, a reasonable default minimum and maximum, indicating the range used by most queries, is probably -20 degrees (F) to +120 degrees (F) for temperatures in the continental US.