Add important info about ANALYZE after create Functional Index - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Add important info about ANALYZE after create Functional Index
Date
Msg-id CAFcNs+qpFPmiHd1oTXvcPdvAHicJDA9qBUSujgAhUMJyUMb+SA@mail.gmail.com
Whole thread Raw
Responses Re: Add important info about ANALYZE after create Functional Index
Re: Add important info about ANALYZE after create Functional Index
List pgsql-hackers
Hi all,

As you all already know Postgres supports functions in index expressions (marked as immutable ofc) and for this special index the ANALYZE command creates some statistics (new pg_statistic entry) about it.

The problem is just after creating a new index or rebuilding concurrently (using the new REINDEX .. CONCURRENTLY or the old manner creating new one and then swapping) we need to run ANALYZE to update statistics but we don't mention it in any part of our documentation.

Last weekend Gitlab went down because the lack of an ANALYZE after rebuilding concurrently a functional index and they followed the recommendation we have into our documentation [1] about how to rebuild it concurrently, but we don't warn users about the ANALYZE after.

Would be nice if add some information about it into our docs but not sure where. I'm thinking about:
- doc/src/sgml/ref/create_index.sgml
- doc/src/sgml/maintenance.sgml (routine-reindex)

Thoughts?


--
   Fabrízio de Royes Mello
   PostgreSQL Developer at OnGres Inc. - https://ongres.com

pgsql-hackers by date:

Previous
From: John Hsu
Date:
Subject: Re: Improve pg_dump dumping publication tables
Next
From: "David G. Johnston"
Date:
Subject: Re: Add important info about ANALYZE after create Functional Index