Home Explore Blog CI



postgresql

11th chunk of `doc/src/sgml/pageinspect.sgml`
e97eb172b0c60294e5ef6693ae77041d1460b33cebedb5ea00000001000008f2
 |      40 | f    | \x00000500ffff28000000000000f0894000000000&zwsp;00f089400000000000c884400000000000c88440
          6 | (6,65535) |      40 | f    | \x00000600ffff28000000000000208f4000000000&zwsp;00208f400000000000f889400000000000f88940
          7 | (7,65535) |      40 | f    | \x00000700ffff28000000000000408f4000000000&zwsp;00408f400000000000288f400000000000288f40
(7 rows)
</screen>
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </sect2>

 <sect2 id="pageinspect-hash-funcs">
  <title>Hash Functions</title>

  <variablelist>
   <varlistentry>
    <term>
     <function>hash_page_type(page bytea) returns text</function>
     <indexterm>
      <primary>hash_page_type</primary>
     </indexterm>
    </term>

    <listitem>
     <para>
      <function>hash_page_type</function> returns page type of
      the given <acronym>HASH</acronym> index page.  For example:
<screen>
test=# SELECT hash_page_type(get_raw_page('con_hash_index', 0));
 hash_page_type
----------------
 metapage
</screen>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>
     <function>hash_page_stats(page bytea) returns setof record</function>
     <indexterm>
      <primary>hash_page_stats</primary>
     </indexterm>
    </term>

    <listitem>
     <para>
      <function>hash_page_stats</function> returns information about
      a bucket or overflow page of a <acronym>HASH</acronym> index.
      For example:
<screen>
test=# SELECT * FROM hash_page_stats(get_raw_page('con_hash_index', 1));
-[ RECORD 1 ]---+-----------
live_items      | 407
dead_items      | 0
page_size       | 8192
free_size       | 8
hasho_prevblkno | 4096
hasho_nextblkno | 8474
hasho_bucket    | 0
hasho_flag      | 66
hasho_page_id   | 65408
</screen>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>
     <function>hash_page_items(page bytea) returns setof record</function>
     <indexterm>
      <primary>hash_page_items</primary>
     </indexterm>
    </term>

    <listitem>
     <para>
      <function>hash_page_items</function> returns information about
      the data stored in a bucket or overflow page of a <acronym>HASH</acronym>
      index page.  For example:
<screen>
test=# SELECT * FROM hash_page_items(get_raw_page('con_hash_index',

Title: Hash Index Page Inspection Functions
Summary
The pageinspect module provides functions to analyze and inspect HASH index pages, including hash_page_type, hash_page_stats, and hash_page_items, which return information about page types, page statistics, and data stored in bucket or overflow pages, allowing for a deeper understanding of HASH index structure and operation.