From 14ffaece0fb53fed8ddbc46d2b353e1c4834863a Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Sat, 29 Mar 2025 15:43:55 +0100 Subject: amcheck: Add gin_index_check() to verify GIN index Adds a new function, validating two kinds of invariants on a GIN index: - parent-child consistency: Paths in a GIN graph have to contain consistent keys. Tuples on parent pages consistently include tuples from child pages; parent tuples do not require any adjustments. - balanced-tree / graph: Each internal page has at least one downlink, and can reference either only leaf pages or only internal pages. The GIN verification is based on work by Grigory Kryachko, reworked by Heikki Linnakangas and with various improvements by Andrey Borodin. Investigation and fixes for multiple bugs by Kirill Reshke. Author: Grigory Kryachko Author: Heikki Linnakangas Author: Andrey Borodin Reviewed-By: José Villanova Reviewed-By: Aleksander Alekseev Reviewed-By: Nikolay Samokhvalov Reviewed-By: Andres Freund Reviewed-By: Tomas Vondra Reviewed-By: Kirill Reshke Reviewed-By: Mark Dilger Reviewed-By: Peter Geoghegan Discussion: https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1%40yandex-team.ru --- doc/src/sgml/amcheck.sgml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml index a12aa3abf01..98f836e15e7 100644 --- a/doc/src/sgml/amcheck.sgml +++ b/doc/src/sgml/amcheck.sgml @@ -188,6 +188,26 @@ ORDER BY c.relpages DESC LIMIT 10; + + + + gin_index_check(index regclass) returns void + + gin_index_check + + + + + + gin_index_check tests that its target GIN index + has consistent parent-child tuples relations (no parent tuples + require tuple adjustement) and page graph respects balanced-tree + invariants (internal pages reference only leaf page or only internal + pages). + + + + -- cgit v1.2.3