Object Management Extension User Guide > Object Management Extension User Guide > Defining Data Types > helem Routine--Create a Histogram Element for Data Value
Was this helpful?
helem Routine--Create a Histogram Element for Data Value
This routine creates a histogram value for a data element. Place the address of this routine in the dtd_helem_addr field of the IIADD_DT_DFN structure. If the II_DT_NOHISTOGRAM attribute is present, then this routine is not necessary.
A histogram value is a representation of the data element. The DBMS query optimizer uses histogram values in the evaluation of query plans. The optimizer restricts the length of the histogram value to 8.
The comparison of the histograms of two values must match the comparison of their respective values, because the histogram value definition (if a < b, then h(a) < h(b) ) assumes that 'a < b' uses the same compare routine. Histograms values have a type-for details, see the description hg_dtln Routine.
Inputs
The inputs for this function are:
scb
Pointer to SCB
dv_from
Value for which a histogram is desired
dv_histogram
Pointer to data value into which to place the histogram value
db_datatype
Contains the type of the histogram value
db_length
Contains the length of the histogram value
db_data
Pointer to space of (db_length) bytes into which the histogram value is placed
Outputs
The outputs for this function are:
*(dv_histogram-> db_data)
Contains the histogram value
Returns
II_STATUS
Last modified date: 04/03/2024