2 9.31. Statistics Information Functions #
4 9.31.1. Inspecting MCV Lists
6 PostgreSQL provides a function to inspect complex statistics defined
7 using the CREATE STATISTICS command.
9 9.31.1. Inspecting MCV Lists #
11 pg_mcv_list_items ( pg_mcv_list ) → setof record
13 pg_mcv_list_items returns a set of records describing all items stored
14 in a multi-column MCV list. It returns the following columns:
16 index integer index of the item in the MCV list
17 values text[] values stored in the MCV item
18 nulls boolean[] flags identifying NULL values
19 frequency double precision frequency of this MCV item
20 base_frequency double precision base frequency of this MCV item
22 The pg_mcv_list_items function can be used like this:
23 SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
24 pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts';
26 Values of the pg_mcv_list type can be obtained only from the
27 pg_statistic_ext_data.stxdmcv column.