This procedure, intended for internal diagnostic purposes, retrieves column statistics from the database server for the specified
columns. Note that while these statistics are permanently stored in the ISYSCOLSTAT system table, they are maintained in memory
while the server is running, and written to ISYSCOLSTAT periodically. As such, the statistics returned by the sa_get_histogram
system procedure may differ from those obtained by selecting from ISYSCOLSTAT at any given point of time.
You can manually update ISYSCOLSTAT with the latest statistics held in memory using the sa_flush_statistics system procedure,
however, this is not recommended in a production environment, and should be reserved for diagnostic purposes.
A singleton bucket is indicated by a Low value in the result set being equal to the corresponding High value.
It is recommended that you use the Histogram utility to view histograms.
To determine the selectivity of a predicate over a string column, use the ESTIMATE or ESTIMATE_SOURCE functions. For string
columns, both sa_get_histogram and the Histogram utility retrieve nothing from the ISYSCOLSTAT system table. Attempting to
retrieve string data generates an error.
Statistics (including histograms) may not be present for a table or materialized view, for example, if statistics were recently
dropped. In this case, the result set for the sa_get_histogram system procedure is empty. To create statistics for a table
or materialized view, execute a CREATE STATISTICS statement.