Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Mihail Nikalayeu <michail.nikolaev@gmail.com>
From: Michail Nikolaev <michail.nikolaev@gmail.com>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Andrey Borodin <amborodin86@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>
Date: 2024-11-12T15:00:00Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Revert changes to CONCURRENTLY that "sped up" Xmin advance
- e28bb8851969 15.0 cited
-
VACUUM: ignore indexing operations with CONCURRENTLY
- d9d076222f5b 14.0 cited
-
Avoid spurious waits in concurrent indexing
- c98763bf51bf 14.0 cited
Attachments
- v1-0001-Allow-advancing-xmin-during-non-unique-non-parall.patch (text/x-patch) patch v1-0001
Hello, everyone! With winter approaching, it’s the perfect time to dive back into work on this patch! :) The first attached patch implements Matthias's idea of periodically resetting the snapshot during the initial heap scan. The next step will be to add support for parallel builds. Additionally, here are a few comments on previous emails: > In heapam_index_build_range_scan, it seems like you're popping the > snapshot and registering a new one while holding a tuple from > heap_getnext(), thus while holding a page lock. I'm not so sure that's > OK, expecially when catalogs are also involved (specifically for > expression indexes, where functions could potentially be updated or > dropped if we re-create the visibility snapshot) Now, visibility snapshots are updated between pages. As for the catalog snapshot: * Dropping functions isn’t possible due to dependencies and locking constraints. * Updating functions is possible, but it offers the same level of isolation as we have now: 1) Functions are already converted into an execution state and aren’t re-read from the catalog during the scan. 2) During the validation phase, the latest version of a function will be used. 3) Even in the initial phase, predicates and expressions could be read using different catalog snapshots, as it’s possible to receive a cache invalidation message before the first FormIndexDatum is created. Best regards, Mikhail. >