From c6ec56913d933f328f4e54ac1ab7123a02d4bccf Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Tue, 27 Oct 2020 07:01:34 +0000 Subject: [PATCH] Building indexes on expressions requires ANALYZE It is critically important to run ANALYZE after an index on an expression is created. --- doc/src/sgml/indices.sgml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 671299ff05..bb5d7dfdd5 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -741,6 +741,15 @@ CREATE INDEX people_names ON people ((first_name || ' ' || last_name)); query. Thus, indexes on expressions are useful when retrieval speed is more important than insertion and update speed. + + + Note + + Once an index on an expression is successfuly created, it is important to + run ANALYZE on the corresponding table to gather + statistics for the expression. + +