Re: AIO writes vs hint bits vs checksums
Antonin Houska <ah@cybertec.at>
From: Antonin Houska <ah@cybertec.at>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Noah Misch <noah@leadboat.com>,
Heikki Linnakangas <hlinnaka@iki.fi>,
Robert Haas <robertmhaas@gmail.com>,
Thomas Munro <thomas.munro@gmail.com>
Date: 2024-09-25T08:12:27Z
Lists: pgsql-hackers
Antonin Houska <ah@cybertec.at> wrote: > Andres Freund <andres@anarazel.de> wrote: > > > What I'd instead like to propose is to implement the right to set hint bits as > > a bit in each buffer's state, similar to BM_IO_IN_PROGRESS. Tentatively I > > named this BM_SETTING_HINTS. It's only allowed to set BM_SETTING_HINTS when > > BM_IO_IN_PROGRESS isn't already set and StartBufferIO has to wait for > > BM_SETTING_HINTS to be unset to start IO. > > > > Naively implementing this, by acquiring and releasing the permission to set > > hint bits in SetHintBits() unfortunately leads to a significant performance > > regression. While the performance is unaffected for OLTPish workloads like > > pgbench (both read and write), sequential scans of unhinted tables regress > > significantly, due to the per-tuple lock acquisition this would imply. > > An alternative approach: introduce a flag that tells that the checksum is > being computed, and disallow setting hint bits when that flag is set. As long > as the checksum computation takes take much less time than the IO, fewer hint > bit updates should be rejected. Well, the checksum actually should not be computed during the IO, so the IO would still disallow hint bit updates :-( -- Antonin Houska Web: https://www.cybertec-postgresql.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Require share-exclusive lock to set hint bits and to flush
- 82467f627bd4 19 (unreleased) landed
-
heapam: Move logic to handle HEAP_MOVED into a helper function
- 548de59d93d5 19 (unreleased) landed
-
Add very basic test for kill_prior_tuples
- 377b7ab14524 19 (unreleased) landed
-
aio: Add README.md explaining higher level design
- fdd146a8ef2b 18.0 landed
-
heapam: Only set tuple's block once per page in pagemode
- 2904324a88f6 18.0 landed
-
bufmgr: Use AIO in StartReadBuffers()
- 12ce89fd0708 18.0 landed
-
bufmgr: Implement AIO read support
- 047cba7fa0f8 18.0 landed
-
aio: Implement support for reads in smgr/md/fd
- 50cb7505b301 18.0 landed
-
aio: Add io_method=io_uring
- c325a7633fcb 18.0 landed
-
aio: Add io_method=worker
- 247ce06b883d 18.0 landed
-
aio: Infrastructure for io_method=worker
- 55b454d0e140 18.0 landed
-
aio: Add core asynchronous I/O infrastructure
- da7226993fd4 18.0 landed
-
bufmgr: Make it easier to change number of buffer state bits
- 418451bfe161 18.0 landed