gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
8.3KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>51.89. pg_stats_ext</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="view-pg-stats.html" title="51.88. pg_stats" /><link rel="next" href="view-pg-tables.html" title="51.90. pg_tables" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">51.89. <code xmlns="http://www.w3.org/1999/xhtml" class="structname">pg_stats_ext</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="view-pg-stats.html" title="51.88. pg_stats">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="Chapter 51. System Catalogs">Up</a></td><th width="60%" align="center">Chapter 51. System Catalogs</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="view-pg-tables.html" title="51.90. pg_tables">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="VIEW-PG-STATS-EXT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">51.89. <code class="structname">pg_stats_ext</code></h2></div></div></div><a id="id-1.10.4.91.2" class="indexterm"></a><p>
  3. The view <code class="structname">pg_stats_ext</code> provides access to
  4. the information stored in the <a class="link" href="catalog-pg-statistic-ext.html" title="51.51. pg_statistic_ext"><code class="structname">pg_statistic_ext</code></a>
  5. and <a class="link" href="catalog-pg-statistic-ext-data.html" title="51.52. pg_statistic_ext_data"><code class="structname">pg_statistic_ext_data</code></a>
  6. catalogs. This view allows access only to rows of
  7. <code class="structname">pg_statistic_ext</code> and <code class="structname">pg_statistic_ext_data</code>
  8. that correspond to tables the user has permission to read, and therefore
  9. it is safe to allow public read access to this view.
  10. </p><p>
  11. <code class="structname">pg_stats_ext</code> is also designed to present the
  12. information in a more readable format than the underlying catalogs
  13. — at the cost that its schema must be extended whenever new types
  14. of extended statistics are added to <code class="structname">pg_statistic_ext</code>.
  15. </p><div class="table" id="id-1.10.4.91.5"><p class="title"><strong>Table 51.90. <code class="structname">pg_stats_ext</code> Columns</strong></p><div class="table-contents"><table class="table" summary="pg_stats_ext Columns" border="1"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th>Name</th><th>Type</th><th>References</th><th>Description</th></tr></thead><tbody><tr><td><code class="structfield">schemaname</code></td><td><code class="type">name</code></td><td><code class="literal"><a class="link" href="catalog-pg-namespace.html" title="51.32. pg_namespace"><code class="structname">pg_namespace</code></a>.nspname</code></td><td>Name of schema containing table</td></tr><tr><td><code class="structfield">tablename</code></td><td><code class="type">name</code></td><td><code class="literal"><a class="link" href="catalog-pg-class.html" title="51.11. pg_class"><code class="structname">pg_class</code></a>.relname</code></td><td>Name of table</td></tr><tr><td><code class="structfield">statistics_schemaname</code></td><td><code class="type">name</code></td><td><code class="literal"><a class="link" href="catalog-pg-namespace.html" title="51.32. pg_namespace"><code class="structname">pg_namespace</code></a>.nspname</code></td><td>Name of schema containing extended statistic</td></tr><tr><td><code class="structfield">statistics_name</code></td><td><code class="type">name</code></td><td><code class="literal"><a class="link" href="catalog-pg-statistic-ext.html" title="51.51. pg_statistic_ext"><code class="structname">pg_statistic_ext</code></a>.stxname</code></td><td>Name of extended statistics</td></tr><tr><td><code class="structfield">statistics_owner</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-authid.html" title="51.8. pg_authid"><code class="structname">pg_authid</code></a>.oid</code></td><td>Owner of the extended statistics</td></tr><tr><td><code class="structfield">attnames</code></td><td><code class="type">name[]</code></td><td><code class="literal"><a class="link" href="catalog-pg-attribute.html" title="51.7. pg_attribute"><code class="structname">pg_attribute</code></a>.attname</code></td><td>Names of the columns the extended statistics is defined on</td></tr><tr><td><code class="structfield">kinds</code></td><td><code class="type">text[]</code></td><td> </td><td>Types of extended statistics enabled for this record</td></tr><tr><td><code class="structfield">n_distinct</code></td><td><code class="type">pg_ndistinct</code></td><td> </td><td>N-distinct counts for combinations of column values. If greater
  16. than zero, the estimated number of distinct values in the combination.
  17. If less than zero, the negative of the number of distinct values divided
  18. by the number of rows.
  19. (The negated form is used when <code class="command">ANALYZE</code> believes that
  20. the number of distinct values is likely to increase as the table grows;
  21. the positive form is used when the column seems to have a fixed number
  22. of possible values.) For example, -1 indicates a unique combination of
  23. columns in which the number of distinct combinations is the same as the
  24. number of rows.
  25. </td></tr><tr><td><code class="structfield">dependencies</code></td><td><code class="type">pg_dependencies</code></td><td> </td><td>Functional dependency statistics</td></tr><tr><td><code class="structfield">most_common_vals</code></td><td><code class="type">anyarray</code></td><td> </td><td>
  26. A list of the most common combinations of values in the columns.
  27. (Null if no combinations seem to be more common than any others.)
  28. </td></tr><tr><td><code class="structfield">most_common_val_nulls</code></td><td><code class="type">anyarray</code></td><td> </td><td>
  29. A list of NULL flags for the most common combinations of values.
  30. (Null when <code class="structfield">most_common_vals</code> is.)
  31. </td></tr><tr><td><code class="structfield">most_common_freqs</code></td><td><code class="type">real[]</code></td><td> </td><td>
  32. A list of the frequencies of the most common combinations,
  33. i.e., number of occurrences of each divided by total number of rows.
  34. (Null when <code class="structfield">most_common_vals</code> is.)
  35. </td></tr><tr><td><code class="structfield">most_common_base_freqs</code></td><td><code class="type">real[]</code></td><td> </td><td>
  36. A list of the base frequencies of the most common combinations,
  37. i.e., product of per-value frequencies.
  38. (Null when <code class="structfield">most_common_vals</code> is.)
  39. </td></tr></tbody></table></div></div><br class="table-break" /><p>
  40. The maximum number of entries in the array fields can be controlled on a
  41. column-by-column basis using the <code class="command">ALTER TABLE SET STATISTICS</code>
  42. command, or globally by setting the
  43. <a class="xref" href="runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET">default_statistics_target</a> run-time parameter.
  44. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="view-pg-stats.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="view-pg-tables.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">51.88. <code class="structname">pg_stats</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 51.90. <code class="structname">pg_tables</code></td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1