Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Matthias van de Meent <boekewurm+postgres@gmail.com>
From: Matthias van de Meent <boekewurm+postgres@gmail.com>
To: Michail Nikolaev <michail.nikolaev@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andrey Borodin <amborodin86@gmail.com>,
Melanie Plageman <melanieplageman@gmail.com>
Date: 2025-01-04T01:12:58Z
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
On Wed, 1 Jan 2025 at 17:17, Michail Nikolaev <michail.nikolaev@gmail.com> wrote: > > Hello, everyone! > > I’ve added several updates to the patch set: > > * Automatic auxiliary index removal where applicable. > * Documentation updates to reflect recent changes. > * Optimization for STIR indexes: skipping datum setup, as they store only TIDs. > * Numerous assertions to ensure that MyProc->xmin is invalid where necessary. > > I’d like to share some initial benchmark results (see attached graphs). > This involves building a B-tree index on (aid, abalance) in a pgbench setup with scale 2000 (with WAL), while running a concurrent pgbench workload. > > The patched version built the index in 68 seconds, compared to 117 seconds with the master branch (mostly because of a single heap scan). > There appears to be no effect on the throughput of the concurrent pgbench. > The maximum snapshot age remains near zero. Thank you for continuing working on this, these are some nice results. I'm sorry I can't spend the time I want on this every time, but I still think it's important this can eventually get committed, so thank you for your work. > (mostly because of a single heap scan). Isn't there a second heap scan, or do you consider that an index scan? > I am going to continue to benchmark with different options: different HOT setup, unique index, different index types and DB size (100+ GB). > If someone has some ideas about possible benchmark scenarios - please share. I think a good benchmark could show how bloat is actually prevented, i.e. through result table size comparisons on an update-heavy workload, both with and without the patch. I think it shouldn't be too difficult to show how such workloads quickly regress to always extending the table as no cleanup can happen, while patched they'd have much more leeway due to page pruning. Presumably a table with a fillfactor <100 would show the best results. Kind regards, Matthias van de Meent Neon (https://neon.tech)