Re: pg_stats.avg_width

Поиск
Список
Период
Сортировка
От Maciek Sakrejda
Тема Re: pg_stats.avg_width
Дата
Msg-id CAOtHd0AGRN6_P8a9oiyudGE5ATOSsvzm6ftpekkPuUuF0hQmuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_stats.avg_width  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thanks, that makes sense. It was going to be my third guess, but it
seemed pretty wide for a TOAST pointer. Reviewing what goes in there,
though, it's reasonable.

I assume that this means for unTOASTed but compressed data, this
counts the compressed size.

Would a doc patch clarifying this (and possibly linking to the
relevant TOAST docs [1]) be welcome? The current wording is pretty
vague. Something like

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 7c09ab3000..2814ac8007 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -7466,7 +7466,9 @@ SCRAM-SHA-256$<replaceable><iteration
count></replaceable>:<replaceable>&l
        <structfield>stawidth</structfield> <type>int4</type>
       </para>
       <para>
-       The average stored width, in bytes, of nonnull entries
+       The average stored width, in bytes, of nonnull entries. For compressed
+       entries, counts the compressed size; for TOASTed data, the size of the
+       TOAST pointer (see <link linkend="storage-toast">TOAST</link>).
       </para></entry>
      </row>

diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml
index bb1a418450..62184fe32b 100644
--- a/doc/src/sgml/system-views.sgml
+++ b/doc/src/sgml/system-views.sgml
@@ -3680,7 +3680,9 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        <structfield>avg_width</structfield> <type>int4</type>
       </para>
       <para>
-       Average width in bytes of column's entries
+       Average width in bytes of column's entries. For compressed entries,
+       counts the compressed size; for TOASTed data, the size of the TOAST
+       pointer (see <link linkend="storage-toast">TOAST</link>).
       </para></entry>
      </row>

(not sure if this should be <link /> or <xref />).

Thanks,
Maciek

[1]: https://www.postgresql.org/docs/current/storage-toast.html



В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond Brinzer
Дата:
Сообщение: Re: Records, Types, and Arrays
Следующее
От: Raymond Brinzer
Дата:
Сообщение: Re: Records, Types, and Arrays