On Mon, Dec 4, 2017 at 3:37 PM, Adrien Nayrat <adrien.nayrat@xxxxxxxxxx> wrote:
Stats are deleted after promotion :
" The stats file is deleted at the start of recovery, so stats from primary and
standby will differ; this is considered a feature, not a bug."
https://www.postgresql.org/docs/current/static/hot- standby.html
Or : https://www.postgresql.org/message-id/31781.1508448417% 40sss.pgh.pa.us
You have to do an ANALYZE just after promotion.