From 8f22fe2025bf97bc2bd6e0a7b3acf97ab970a4e2 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 22 Dec 2021 16:29:16 -0500 Subject: [PATCH] doc: clarify when expression indexes evaluate their expressions Only non-HOT updates evaluate the index expression. Reported-by: Chris Lowder Discussion: https://postgr.es/m/163967385701.26064.15365003480975321072@wrigleys.postgresql.org Backpatch-through: 10 --- doc/src/sgml/indices.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 3d5325de916..8a9beae7b43 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -725,8 +725,8 @@ CREATE INDEX people_names ON people ((first_name || ' ' || last_name)); Index expressions are relatively expensive to maintain, because the - derived expression(s) must be computed for each row upon insertion - and whenever it is updated. However, the index expressions are + derived expression(s) must be computed for each row insertion + and non-HOT update. However, the index expressions are not recomputed during an indexed search, since they are already stored in the index. In both examples above, the system sees the query as just WHERE indexedcolumn = 'constant' -- 2.39.5