]> begriffs open source - ai-pg/blob - full-docs/txt/functions-statistics.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / functions-statistics.txt
1
2 9.31. Statistics Information Functions #
3
4    9.31.1. Inspecting MCV Lists
5
6    PostgreSQL provides a function to inspect complex statistics defined
7    using the CREATE STATISTICS command.
8
9 9.31.1. Inspecting MCV Lists #
10
11 pg_mcv_list_items ( pg_mcv_list ) → setof record
12
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:
15         Name            Type                  Description
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
21
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';
25
26    Values of the pg_mcv_list type can be obtained only from the
27    pg_statistic_ext_data.stxdmcv column.