RFE: Make statistics robust for unplanned events - Mailing list pgsql-hackers

From Patrik Novotny
Subject RFE: Make statistics robust for unplanned events
Date
Msg-id CAE_EZkh7FsDY0wHqpbqYG9JFZogVhPebUiDSQB7OLjVUYrw6Eg@mail.gmail.com
Whole thread Raw
Responses Re: RFE: Make statistics robust for unplanned events  (Peter Geoghegan <pg@bowt.ie>)
Re: RFE: Make statistics robust for unplanned events  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Hello PostgreSQL Hackers,

is it possible to preserve the PostgreSQL statistics on a server crash?

Steps to reproduce the behaviour:
1) Observe the statistics counters, take note
2) Crash the machine, e.g. with sysrq; perhaps kill -9 on postgresql will already suffice
3) After recovery, observe the statistics counter again. Have they been reset to zero (Bad) or are they preserved (Good).

Resetting the counters to zero harms execution planning and auto_vacuum
operations. That can cause growth of database as dead tuples are not removed
at the right time. In the end the database can go offline if autovacuum never runs.

As far as I've checked, this would have to be implemented.

My question would be whether there is something that would make this impossible to implement, and if there isn't, I'd like this to be considered a feature request.


Regards

--
Patrik Novotný
Associate Software Engineer
Red Hat
panovotn@redhat.com  

pgsql-hackers by date:

Previous
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Table refer leak in logical replication
Next
From: James Coleman
Date:
Subject: Re: "could not find pathkey item to sort" for TPC-DS queries 94-96