Home Explore Blog CI



postgresql

4th chunk of `doc/src/sgml/pgstattuple.sgml`
0999a3c9e806b0018cf04e3b0684479d98bfd7413cccf7110000000100000fa0
 <varlistentry>
    <term>
     <indexterm>
      <primary>pgstatginindex</primary>
     </indexterm>
     <function>pgstatginindex(regclass) returns record</function>
    </term>

    <listitem>
     <para>
      <function>pgstatginindex</function> returns a record showing information
      about a GIN index.  For example:
<programlisting>
test=&gt; SELECT * FROM pgstatginindex('test_gin_index');
-[ RECORD 1 ]--+--
version        | 1
pending_pages  | 0
pending_tuples | 0
</programlisting>
     </para>

    <para>
     The output columns are:

    <informaltable>
     <tgroup cols="3">
      <thead>
       <row>
        <entry>Column</entry>
        <entry>Type</entry>
        <entry>Description</entry>
       </row>
      </thead>

      <tbody>
       <row>
        <entry><structfield>version</structfield></entry>
        <entry><type>integer</type></entry>
        <entry>GIN version number</entry>
       </row>

       <row>
        <entry><structfield>pending_pages</structfield></entry>
        <entry><type>integer</type></entry>
        <entry>Number of pages in the pending list</entry>
       </row>

       <row>
        <entry><structfield>pending_tuples</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of tuples in the pending list</entry>
       </row>

      </tbody>
     </tgroup>
    </informaltable>
    </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>
     <indexterm>
      <primary>pgstathashindex</primary>
     </indexterm>
     <function>pgstathashindex(regclass) returns record</function>
    </term>

    <listitem>
     <para>
      <function>pgstathashindex</function> returns a record showing information
      about a HASH index.  For example:
<programlisting>
test=&gt; select * from pgstathashindex('con_hash_index');
-[ RECORD 1 ]--+-----------------
version        | 4
bucket_pages   | 33081
overflow_pages | 0
bitmap_pages   | 1
unused_pages   | 32455
live_items     | 10204006
dead_items     | 0
free_percent   | 61.8005949100872
</programlisting>
     </para>

    <para>
     The output columns are:

    <informaltable>
     <tgroup cols="3">
      <thead>
       <row>
        <entry>Column</entry>
        <entry>Type</entry>
        <entry>Description</entry>
       </row>
      </thead>

      <tbody>
       <row>
        <entry><structfield>version</structfield></entry>
        <entry><type>integer</type></entry>
        <entry>HASH version number</entry>
       </row>

       <row>
        <entry><structfield>bucket_pages</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of bucket pages</entry>
       </row>

       <row>
        <entry><structfield>overflow_pages</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of overflow pages</entry>
       </row>

       <row>
        <entry><structfield>bitmap_pages</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of bitmap pages</entry>
       </row>

       <row>
        <entry><structfield>unused_pages</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of unused pages</entry>
       </row>

       <row>
        <entry><structfield>live_items</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of live tuples</entry>
       </row>

       <row>
        <entry><structfield>dead_tuples</structfield></entry>
        <entry><type>bigint</type></entry>
        <entry>Number of dead tuples</entry>
       </row>

       <row>
        <entry><structfield>free_percent</structfield></entry>
        <entry><type>float</type></entry>
        <entry>Percentage of free space</entry>
       </row>

      </tbody>
     </tgroup>
    </informaltable>
    </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>
     <indexterm>
      <primary>pg_relpages</primary>
     </indexterm>
     <function>pg_relpages(regclass) returns

Title: pgstatginindex and pgstathashindex Functions: Output Columns and Descriptions
Summary
The pgstatginindex function provides details about GIN indexes, including the GIN version number, the number of pages in the pending list, and the number of tuples in the pending list. The pgstathashindex function provides information about HASH indexes, including the HASH version, number of bucket pages, overflow pages, bitmap pages, unused pages, live tuples, dead tuples, and the percentage of free space within the index.