docs: mention that expression indexes need analyze
authorBruce Momjian
Thu, 12 Nov 2020 20:00:44 +0000 (15:00 -0500)
committerBruce Momjian
Thu, 12 Nov 2020 20:00:44 +0000 (15:00 -0500)
Expression indexes can't benefit from pre-computed statistics on
columns.

Reported-by: Nikolay Samokhvalov
Discussion: https://postgr.es/m/CANNMO++5rw9RDA=p40iMVbMNPaW6O=S0AFzTU=KpYHRpCd1voA@mail.gmail.com

Author: Nikolay Samokhvalov, modified

Backpatch-through: 9.5

doc/src/sgml/ref/create_index.sgml

index e48990d00351c7f49244e2412d5910bb9ccd8294..bfdb9211d3bed4a0655c7773b6c527885dd6b574 100644 (file)
@@ -704,6 +704,16 @@ Indexes:
    sort high, in queries that depend on indexes to avoid sorting steps.
   
 
+  
+   The regularly system collects statistics on all of a table's
+   columns.  Newly-created non-expression indexes can immediately
+   use these statistics to determine an index's usefulness.
+   For new expression indexes, it is necessary to run 
+   linkend="sql-analyze">ANALYZE or wait for
+   the autovacuum daemon to analyze
+   the table to generate statistics about new expression indexes.
+  
+
   
    For most index methods, the speed of creating an index is
    dependent on the setting of .