Re: error context for vacuum to include block number
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Justin Pryzby <pryzby@telsasoft.com>,
Michael Paquier <michael@paquier.xyz>, Alvaro Herrera <alvherre@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-14T01:40:26Z
Lists: pgsql-hackers
On Tue, Jan 21, 2020 at 8:11 AM Andres Freund <andres@anarazel.de> wrote: > FWIW, I think we should just flat out delete all this logic, and replace > it with a few explicit PrefetchBuffer() calls. Just by chance I > literally just now sped up a VACUUM by more than a factor of 10, by > manually prefetching buffers. At least the linux kernel readahead logic > doesn't deal well with reading and writing to different locations in the > same file, and that's what the ringbuffer pretty invariably leads to for > workloads that aren't cached. Interesting. Andrew Gierth made a similar observation on FreeBSD, and showed that by patching his kernel to track sequential writes and sequential reads separately he could improve performance, and I reproduced the same speedup in a patch of my own based on his description (that, erm, I've lost). It's not only VACUUM, it's anything that is writing to a lot of sequential blocks, since the writeback trails along behind by some distance (maybe a ring buffer, maybe all of shared buffers, whatever). The OS sees you flipping back and forth between single block reads and writes and thinks it's random. I didn't investigate this much but it seemed that ZFS was somehow smart enough to understand what was happening at some level but other filesystems were not.
Commits
-
Avoid calls to RelationGetRelationName() and RelationGetNamespace() in
- ef75140fe756 13.0 landed
-
Introduce vacuum errcontext to display additional information.
- b61d161c1463 13.0 landed
-
Fix mesurement of elapsed time during truncating heap in VACUUM.
- 007491979461 13.0 cited
-
Allow vacuum command to process indexes in parallel.
- 40d964ec997f 13.0 cited
-
Refactor code dedicated to index vacuuming in vacuumlazy.c
- 1ab41a3c8edc 13.0 landed
-
Remove duplicated progress reporting during heap scan of VACUUM
- e5a02e0fc68b 13.0 landed