public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: [email protected]
Subject: pgsql: amcheck: Add gin_index_check() to verify GIN index
Date: Sat, 29 Mar 2025 14:44:54 +0000
Message-ID: <[email protected]> (raw)

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 <[email protected]>
Author: Heikki Linnakangas <[email protected]>
Author: Andrey Borodin <[email protected]>
Reviewed-By: José Villanova <[email protected]>
Reviewed-By: Aleksander Alekseev <[email protected]>
Reviewed-By: Nikolay Samokhvalov <[email protected]>
Reviewed-By: Andres Freund <[email protected]>
Reviewed-By: Tomas Vondra <[email protected]>
Reviewed-By: Kirill Reshke <[email protected]>
Reviewed-By: Mark Dilger <[email protected]>
Reviewed-By: Peter Geoghegan <[email protected]>
Discussion: https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1%40yandex-team.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/14ffaece0fb53fed8ddbc46d2b353e1c4834863a

Modified Files
--------------
contrib/amcheck/Makefile               |   6 +-
contrib/amcheck/amcheck--1.4--1.5.sql  |  14 +
contrib/amcheck/amcheck.control        |   2 +-
contrib/amcheck/expected/check_gin.out |  64 +++
contrib/amcheck/meson.build            |   3 +
contrib/amcheck/sql/check_gin.sql      |  40 ++
contrib/amcheck/verify_gin.c           | 798 +++++++++++++++++++++++++++++++++
doc/src/sgml/amcheck.sgml              |  20 +
src/tools/pgindent/typedefs.list       |   2 +
9 files changed, 946 insertions(+), 3 deletions(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: amcheck: Add gin_index_check() to verify GIN index
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox