From 293913568e6a7a86fd1479e1cff8e2ecb58d6568 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 15:44:03 +0200 Subject: Adding upstream version 16.2. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/routine-reindex.html | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/src/sgml/html/routine-reindex.html (limited to 'doc/src/sgml/html/routine-reindex.html') diff --git a/doc/src/sgml/html/routine-reindex.html b/doc/src/sgml/html/routine-reindex.html new file mode 100644 index 0000000..5d477d1 --- /dev/null +++ b/doc/src/sgml/html/routine-reindex.html @@ -0,0 +1,31 @@ + +25.2. Routine Reindexing

25.2. Routine Reindexing #

+ In some situations it is worthwhile to rebuild indexes periodically + with the REINDEX command or a series of individual + rebuilding steps. + +

+ B-tree index pages that have become completely empty are reclaimed for + re-use. However, there is still a possibility + of inefficient use of space: if all but a few index keys on a page have + been deleted, the page remains allocated. Therefore, a usage + pattern in which most, but not all, keys in each range are eventually + deleted will see poor use of space. For such usage patterns, + periodic reindexing is recommended. +

+ The potential for bloat in non-B-tree indexes has not been well + researched. It is a good idea to periodically monitor the index's physical + size when using any non-B-tree index type. +

+ Also, for B-tree indexes, a freshly-constructed index is slightly faster to + access than one that has been updated many times because logically + adjacent pages are usually also physically adjacent in a newly built index. + (This consideration does not apply to non-B-tree indexes.) It + might be worthwhile to reindex periodically just to improve access speed. +

+ REINDEX can be used safely and easily in all cases. + This command requires an ACCESS EXCLUSIVE lock by + default, hence it is often preferable to execute it with its + CONCURRENTLY option, which requires only a + SHARE UPDATE EXCLUSIVE lock. +

\ No newline at end of file -- cgit v1.2.3