From d114cc538715e14d29d6de8b6ea1a1d5d3e0edb4 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Wed, 11 Mar 2020 12:00:31 +0300 Subject: Improve checking of child pages in contrib/amcheck. This commit eliminates lossiness in check for missing parent downlinks in B-tree. Instead of collecting lossy bitmap, we check for missing downlinks while visiting child pages referenced by downlinks of target level. We traverse from previous child page to the subsequent child page by right links. Intermediate pages are candidates to have lost parent downlinks. Also this commit introduces matching of child high key to the pivot key of it's parent. Discussion: https://postgr.es/m/CAPpHfduoF-c4RhOyOm%3D4-Y367%2B8txq9Q6iM_ty0OYc8si1Abww%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Peter Geoghegan --- doc/src/sgml/amcheck.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/src/sgml/amcheck.sgml') diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml index fe0fe9c186e..c912d2aa895 100644 --- a/doc/src/sgml/amcheck.sgml +++ b/doc/src/sgml/amcheck.sgml @@ -125,8 +125,7 @@ ORDER BY c.relpages DESC LIMIT 10; Optionally, when the heapallindexed argument is true, the function verifies the presence of all heap tuples that should be found within the - index, and that there are no missing downlinks in the index - structure. When the optional rootdescend + index. When the optional rootdescend argument is true, verification re-finds tuples on the leaf level by performing a new search from the root page for each tuple. The checks that can be performed by @@ -136,7 +135,8 @@ ORDER BY c.relpages DESC LIMIT 10; a more thorough variant of bt_index_check: unlike bt_index_check, bt_index_parent_check also checks - invariants that span parent/child relationships. + invariants that span parent/child relationships, including checking + that there are no missing downlinks in the index structure. bt_index_parent_check follows the general convention of raising an error if it finds a logical inconsistency or other problem. -- cgit v1.2.3