Re: Statistics Import and Export: difference in statistics dumped

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: Statistics Import and Export: difference in statistics dumped
Дата
Msg-id CAExHW5uL3++omHqoun2wMU0EUwb7R26F=SjCne6wZDGJzE3VOw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Statistics Import and Export: difference in statistics dumped  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Statistics Import and Export: difference in statistics dumped
Список pgsql-hackers
On Sat, Mar 1, 2025 at 1:40 AM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Fri, 2025-02-28 at 14:51 +0530, Ashutosh Bapat wrote:
> > 2. We aren't restoring the statistics faithfully - as mentioned in
> > Greg's reply. If users dump and restore with autovacuum turned off,
> > they will be surprised to see the statistics to be different on the
> > original and restored database - which may have other effects like
> > change in plans.
>
> Then let's just address that concern directly: disable updating stats
> implicitly if autovacuum is off. If autovacuum is on, the user
> shouldn't have an expectation of stable stats anyway. Patch attached.

The fact that statistics gets updated is not documented at least under
CREATE INDEX page. So at least users should not rely on that
behaviour. But while we have hold of reltuples wasting a chance to
update it in pg_class does not look right to me. Changing regular
behaviour for the sake of pg_dump/pg_restore doesn't seem right to me.
I think the solution should be on the pg_dump/restore side and not on
the server side.

--
Best Wishes,
Ashutosh Bapat



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