Transactions, stats and analyze (oh-my) - Mailing list pgsql-general

From Steve Crawford
Subject Transactions, stats and analyze (oh-my)
Date
Msg-id CAEfWYyw30KVzorNLrBSg+oMwyRsyK8vsM+xQ5japEGbA9uNv1Q@mail.gmail.com
Whole thread Raw
Responses Re: Transactions, stats and analyze (oh-my)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
We have certain processes that import data then process and distribute the data. Since the processing looks primarily, but not exclusively, at the new records an ANALYZE prior to processing yields better plans. Although the table changes will trigger autovacuum to analyze the table this happens too late to be of use for the subsequent processing so we run an explicit analyze (which, when it collides with autovacuum, triggers a warning in the logs).

I would like to roll a number of steps into a transaction. What happens to the stats data generated by ANALYZE if the transaction is rolled back?

This message says the stats are reverted:

This implies they are not:

Cheers,
Steve

pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: PosgreSQL Security Architecture
Next
From: Tom Lane
Date:
Subject: Re: Transactions, stats and analyze (oh-my)