• last-updated : When the histogram was generated, as a UTC value in YYYY-MM-DD hh:mm:ss.uuuuuu  format. 

• sampling-rate : A number between 0.0 and 1.0 indicating the fraction of data that was sampled to create the histogram. A value of 1 means that all of the data was read (no sampling). 

• histogram-type : The histogram type: 

• singleton : One bucket represents one single value in the column. This histogram type is created when the number of distinct values in the column is less than or equal to the number of buckets specified in the ANALYZE TABLE  statement that generated the histogram. 

• equi-height : One bucket represents a range of values. This histogram type is created when the number of distinct values in the column is greater than the number of buckets specified in the ANALYZE TABLE  statement that generated the histogram. 

• number-of-buckets-specified : The number of buckets specified in the ANALYZE TABLE statement that generated the histogram. 

• data-type : The type of data this histogram contains. This is needed when reading and parsing histograms from persistent storage into memory. The value is one of int , uint  (unsigned integer), double , decimal , datetime , or string  (includes character and binary strings). 

• collation-id : The collation ID for the histogram data. It is mostly meaningful when the data-type value is string . Values correspond to ID  column values in the INFORMATION_SCHEMA.COLLATIONS table. 

To extract particular values from the histogram objects, you can use JSON  operations. For example: 

mysql> SELECT TABLE_NAME, COLUMN_NAME, HISTOGRAM->>’$."data-type"’ AS ’data-type’, JSON_LENGTH(HISTOGRAM->>’$."buckets"’) AS ’bucket-count’ FROM INFORMATION_SCHEMA.COLUMN_STATISTICS; +-----------------+-------------+-----------+--------------+ | TABLE_NAME | COLUMN_NAME | data-type | bucket-count | +-----------------+-------------+-----------+--------------+ | country | Population | int | 226 | | city | Population | int | 1024 | | countrylanguage | Language | string | 457 | +-----------------+-------------+-----------+--------------+ 

The optimizer uses histogram statistics, if applicable, for columns of any data type for which statistics are collected. The optimizer applies histogram statistics to determine row estimates based on the selectivity (filtering effect) of column value comparisons against constant values. Predicates of these forms qualify for histogram use: 

col_name  = constant col_name  <> constant col_name  != constant col_name  > constant col_name  < constant col_name  >= constant col_name  <= constant col_name  IS NULL col_name  IS NOT NULL col_name  BETWEEN constant  AND constant col_name  NOT BETWEEN constant  AND constant col_name  IN ( constant [, constant ] ...) col_name  NOT IN ( constant [, constant ] ...) 

For example, these statements contain predicates that qualify for histogram use: 

