Home Explore Blog CI



postgresql

51th chunk of `doc/src/sgml/system-views.sgml`
b6c4611957ee1b080f66c1cecd9e617778d9149a9eab51db0000000100000fa0
 linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>)
      </para>
      <para>
       If true, the stats include values from child tables, not just the
       values in the specified relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>n_distinct</structfield> <type>pg_ndistinct</type>
      </para>
      <para>
       N-distinct counts for combinations of column values. If greater
       than zero, the estimated number of distinct values in the combination.
       If less than zero, the negative of the number of distinct values divided
       by the number of rows.
       (The negated form is used when <command>ANALYZE</command> believes that
       the number of distinct values is likely to increase as the table grows;
       the positive form is used when the column seems to have a fixed number
       of possible values.)  For example, -1 indicates a unique combination of
       columns in which the number of distinct combinations is the same as the
       number of rows.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>dependencies</structfield> <type>pg_dependencies</type>
      </para>
      <para>
       Functional dependency statistics
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_vals</structfield> <type>text[]</type>
      </para>
      <para>
       A list of the most common combinations of values in the columns.
       (Null if no combinations seem to be more common than any others.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_val_nulls</structfield> <type>bool[]</type>
      </para>
      <para>
       A list of NULL flags for the most common combinations of values.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_freqs</structfield> <type>float8[]</type>
      </para>
      <para>
       A list of the frequencies of the most common combinations,
       i.e., number of occurrences of each divided by total number of rows.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_base_freqs</structfield> <type>float8[]</type>
      </para>
      <para>
       A list of the base frequencies of the most common combinations,
       i.e., product of per-value frequencies.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the array fields can be controlled on a
   column-by-column basis using the <link linkend="sql-altertable"><command>ALTER
   TABLE SET STATISTICS</command></link> command, or globally by setting the
   <xref linkend="guc-default-statistics-target"/> run-time parameter.
  </para>

 </sect1>

 <sect1 id="view-pg-stats-ext-exprs">
  <title><structname>pg_stats_ext_exprs</structname></title>

  <indexterm zone="view-pg-stats-ext-exprs">
   <primary>pg_stats_ext_exprs</primary>
  </indexterm>

  <para>
   The view <structname>pg_stats_ext_exprs</structname> provides access to
   information about all expressions included in extended statistics objects,
   combining information stored in the <link
   linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>
   and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
  

Title: Additional Columns in pg_stats_ext View
Summary
The pg_stats_ext view contains additional columns providing information about extended statistics objects, including N-distinct counts, functional dependency statistics, most common combinations of values, and their frequencies, allowing users to gain deeper insights into the data distribution and relationships within their database tables.