Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/ref/alter_index.sgml`
397bb35d9eab28c85226ad5caa519918afb99e7b7c3f83fa0000000100000b01
 linkend="sql-reindex"><command>REINDEX</command></link>
      to get the desired effects.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>RESET ( <replaceable class="parameter">storage_parameter</replaceable> [, ... ] )</literal></term>
    <listitem>
     <para>
      This form resets one or more index-method-specific storage parameters to
      their defaults.  As with <literal>SET</literal>, a <literal>REINDEX</literal>
      might be needed to update the index entirely.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>ALTER [ COLUMN ] <replaceable class="parameter">column_number</replaceable> SET STATISTICS <replaceable class="parameter">integer</replaceable></literal></term>
    <listitem>
     <para>
      This form sets the per-column statistics-gathering target for
      subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> operations, though can
      be used only on index columns that are defined as an expression.
      Since expressions lack a unique name, we refer to them using the
      ordinal number of the index column.
      The target can be set in the range 0 to 10000; alternatively, set it
      to -1 to revert to using the system default statistics
      target (<xref linkend="guc-default-statistics-target"/>).
      For more information on the use of statistics by the
      <productname>PostgreSQL</productname> query planner, refer to
      <xref linkend="planner-stats"/>.
     </para>
    </listitem>
   </varlistentry>

  </variablelist>
  </para>

 </refsect1>

 <refsect1>
  <title>Parameters</title>

    <variablelist>

     <varlistentry>
      <term><literal>IF EXISTS</literal></term>
      <listitem>
       <para>
        Do not throw an error if the index does not exist. A notice is issued
        in this case.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">column_number</replaceable></term>
      <listitem>
       <para>
        The ordinal number refers to the ordinal (left-to-right) position
        of the index column.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">name</replaceable></term>
      <listitem>
       <para>
        The name (possibly schema-qualified) of an existing index to
        alter.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">new_name</replaceable></term>
      <listitem>
       <para>
        The new name for the index.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">tablespace_name</replaceable></term>
      <listitem>
       <para>
      

Title: ALTER INDEX: Resetting Storage Parameters, Setting Statistics Targets, and Parameters
Summary
This section details the options for resetting storage parameters to defaults, setting per-column statistics targets for expression-based index columns using ordinal numbers, and explains the 'IF EXISTS' parameter. It also defines the 'column_number', 'name', 'new_name', and 'tablespace_name' parameters used with the ALTER INDEX command, focusing on how to modify index behavior and gather statistics effectively.