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.
Inputs
The inputs for this function are:
scb
Pointer to a SCB
dv_from
Pointer to a datavalue containing the type and length for the value
dv_histogram
Pointer to a datavalue for the histogram
Outputs
The outputs for this function are:
*(dv_histogram-db_data)
Filled with the histogram value
Returns
II_STATUS
Last modified date: 08/28/2024