Home Explore Blog CI



postgresql

88th chunk of `doc/src/sgml/catalogs.sgml`
974c187580a7a7c0fa5f00c430887444fae6f4d82389fa5e0000000100000fa0
  <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>stanullfrac</structfield> <type>float4</type>
      </para>
      <para>
       The fraction of the column's entries that are null
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stawidth</structfield> <type>int4</type>
      </para>
      <para>
       The average stored width, in bytes, of nonnull entries
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stadistinct</structfield> <type>float4</type>
      </para>
      <para>
       The number of distinct nonnull data values in the column.
       A value greater than zero is the actual number of distinct values.
       A value less than zero is the negative of a multiplier for the number
       of rows in the table; for example, a column in which about 80% of the
       values are nonnull and each nonnull value appears about twice on
       average could be represented by <structfield>stadistinct</structfield> = -0.4.
       A zero value means the number of distinct values is unknown.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stakind<replaceable>N</replaceable></structfield> <type>int2</type>
      </para>
      <para>
       A code number indicating the kind of statistics stored in the
       <replaceable>N</replaceable>th <quote>slot</quote> of the
       <structname>pg_statistic</structname> row.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>staop<replaceable>N</replaceable></structfield> <type>oid</type>
       (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       An operator used to derive the statistics stored in the
       <replaceable>N</replaceable>th <quote>slot</quote>.  For example, a
       histogram slot would show the <literal>&lt;</literal> operator
       that defines the sort order of the data.
       Zero if the statistics kind does not require an operator.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stacoll<replaceable>N</replaceable></structfield> <type>oid</type>
       (references <link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The collation used to derive the statistics stored in the
       <replaceable>N</replaceable>th <quote>slot</quote>.  For example, a
       histogram slot for a collatable column would show the collation that
       defines the sort order of the data.  Zero for noncollatable data.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stanumbers<replaceable>N</replaceable></structfield> <type>float4[]</type>
      </para>
      <para>
       Numerical statistics of the appropriate kind for the
       <replaceable>N</replaceable>th <quote>slot</quote>, or null if the slot
       kind does not involve numerical values
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stavalues<replaceable>N</replaceable></structfield> <type>anyarray</type>
      </para>
      <para>
       Column data values of the appropriate kind for the
       <replaceable>N</replaceable>th <quote>slot</quote>, or null if the slot
       kind does not store any data values.  Each array's

Title: pg_statistic Columns Continued: Distinct Values, Slots, Operators, Collations, Numbers, and Values
Summary
This section details more columns within the `pg_statistic` catalog. It covers `stadistinct` for the number of distinct values (positive for actual count, negative as a multiplier, zero for unknown), `stakindN` as a code for the statistics type in each slot, `staopN` for the operator used to derive statistics, `stacollN` for the collation used, `stanumbersN` for numerical statistics, and `stavaluesN` for column data values within each slot.