SET_RETONE in statcollect()
For each row of a table, the statcollect() function collects the statistics data for the column that has the user-defined data type. When the iterator-status constant is SET_RETONE, the database server has invoked the statcollect() function on a single row of the table on which statistics is being gathered. At this point, statcollect() reads the column value from the first argument and places it into the statistics-collection structure.
The statcollect() function processes
the statistics on a row-by-row basis; that is, for each iterator status
of SET_RETONE, statcollect() merges the current
column value into the statistics data in the internal statistics-collection
structure. Therefore, the statcollect() function
must perform the following tasks:
- Obtain the address of the statistics-collection structure from the user state of the MI_FPARAM structure with the mi_fp_funcstate() function.
- Compare the current column value with the current maximum and minimum values (if maximum and minimum are desired).
- Merge the current column value into the distribution data in the statistics-collection structure.
- Handle a NULL column value as appropriate for your distribution.