Skip to content

Commit e4b5e5f

Browse files
committed
docs: mention that expression indexes need analyze
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
1 parent 52003bf commit e4b5e5f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/src/sgml/ref/create_index.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,16 @@ Indexes:
741741
sort high</quote>, in queries that depend on indexes to avoid sorting steps.
742742
</para>
743743

744+
<para>
745+
The regularly system collects statistics on all of a table's
746+
columns. Newly-created non-expression indexes can immediately
747+
use these statistics to determine an index's usefulness.
748+
For new expression indexes, it is necessary to run <link
749+
linkend="sql-analyze"><command>ANALYZE</command></link> or wait for
750+
the <link linkend="autovacuum">autovacuum daemon</link> to analyze
751+
the table to generate statistics about new expression indexes.
752+
</para>
753+
744754
<para>
745755
For most index methods, the speed of creating an index is
746756
dependent on the setting of <xref linkend="guc-maintenance-work-mem"/>.

0 commit comments

Comments
 (0)