@@ -30222,6 +30222,78 @@ DETAIL: Make sure pg_wal_replay_wait() isn't called within a transaction with a
30222
30222
</para>
30223
30223
</entry>
30224
30224
</row>
30225
+
30226
+ <row>
30227
+ <entry role="func_table_entry">
30228
+ <para role="func_signature">
30229
+ <indexterm>
30230
+ <primary>pg_set_attribute_stats</primary>
30231
+ </indexterm>
30232
+ <function>pg_set_attribute_stats</function> (
30233
+ <parameter>relation</parameter> <type>regclass</type>,
30234
+ <parameter>attname</parameter> <type>name</type>,
30235
+ <parameter>inherited</parameter> <type>boolean</type>
30236
+ <optional>, <parameter>null_frac</parameter> <type>real</type></optional>
30237
+ <optional>, <parameter>avg_width</parameter> <type>integer</type></optional>
30238
+ <optional>, <parameter>n_distinct</parameter> <type>real</type></optional>
30239
+ <optional>, <parameter>most_common_vals</parameter> <type>text</type>, <parameter>most_common_freqs</parameter> <type>real[]</type> </optional>
30240
+ <optional>, <parameter>histogram_bounds</parameter> <type>text</type> </optional>
30241
+ <optional>, <parameter>correlation</parameter> <type>real</type> </optional>
30242
+ <optional>, <parameter>most_common_elems</parameter> <type>text</type>, <parameter>most_common_elem_freqs</parameter> <type>real[]</type> </optional>
30243
+ <optional>, <parameter>elem_count_histogram</parameter> <type>real[]</type> </optional>
30244
+ <optional>, <parameter>range_length_histogram</parameter> <type>text</type> </optional>
30245
+ <optional>, <parameter>range_empty_frac</parameter> <type>real</type> </optional>
30246
+ <optional>, <parameter>range_bounds_histogram</parameter> <type>text</type> </optional> )
30247
+ <returnvalue>void</returnvalue>
30248
+ </para>
30249
+ <para>
30250
+ Creates or updates attribute-level statistics for the given relation
30251
+ and attribute name to the specified values. The parameters correspond
30252
+ to to attributes of the same name found in the <link
30253
+ linkend="view-pg-stats"><structname>pg_stats</structname></link>
30254
+ view.
30255
+ </para>
30256
+ <para>
30257
+ Optional parameters default to <literal>NULL</literal>, which leave
30258
+ the corresponding statistic unchanged.
30259
+ </para>
30260
+ <para>
30261
+ Ordinarily, these statistics are collected automatically or updated
30262
+ as a part of <xref linkend="sql-vacuum"/> or <xref
30263
+ linkend="sql-analyze"/>, so it's not necessary to call this
30264
+ function. However, it may be useful when testing the effects of
30265
+ statistics on the planner to understand or anticipate plan changes.
30266
+ </para>
30267
+ <para>
30268
+ The caller must have the <literal>MAINTAIN</literal> privilege on
30269
+ the table or be the owner of the database.
30270
+ </para>
30271
+ </entry>
30272
+ </row>
30273
+
30274
+ <row>
30275
+ <entry role="func_table_entry">
30276
+ <para role="func_signature">
30277
+ <indexterm>
30278
+ <primary>pg_clear_attribute_stats</primary>
30279
+ </indexterm>
30280
+ <function>pg_clear_attribute_stats</function> (
30281
+ <parameter>relation</parameter> <type>regclass</type>,
30282
+ <parameter>attname</parameter> <type>name</type>,
30283
+ <parameter>inherited</parameter> <type>boolean</type> )
30284
+ <returnvalue>boolean</returnvalue>
30285
+ </para>
30286
+ <para>
30287
+ Clears table-level statistics for the given relation attribute, as
30288
+ though the table was newly created.
30289
+ </para>
30290
+ <para>
30291
+ The caller must have the <literal>MAINTAIN</literal> privilege on
30292
+ the table or be the owner of the database.
30293
+ </para>
30294
+ </entry>
30295
+ </row>
30296
+
30225
30297
</tbody>
30226
30298
</tgroup>
30227
30299
</table>
0 commit comments