Re: logtape.c stats don't account for unused "prefetched" block numbers
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Jeff Davis <pgsql@j-davis.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-01T23:36:02Z
Lists: pgsql-hackers
On 2020-Jul-30, Peter Geoghegan wrote: > Commit 896ddf9b added prefetching to logtape.c to avoid excessive > fragmentation in the context of hash aggs that spill and have many > batches/tapes. Apparently the preallocation doesn't actually perform > any filesystem operations, so the new mechanism should be zero > overhead when "preallocated" blocks aren't actually used after all > (right?). However, I notice that this breaks the statistics shown by > things like trace_sort, and even EXPLAIN ANALYZE. > LogicalTapeSetBlocks() didn't get the memo about preallocation. This open item hasn't received any replies. I think Peter knows how to fix it already, but no patch has been posted ... It'd be good to get a move on it. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Change LogicalTapeSetBlocks() to use nBlocksWritten.
- 6e146a663536 13.0 landed
- c8aeaf3ab31e 14.0 landed
-
HashAgg: release write buffers sooner by rewinding tape.
- 42a46f5a76ec 13.0 landed
- 3bd35d4f516a 14.0 landed
-
logtape.c: do not preallocate for tapes when sorting
- 93106d71a18a 13.0 landed
- 075896496394 14.0 landed
-
Fix bogus MaxAllocSize check in logtape.c.
- 4a4f3bf983b4 13.0 landed
- 0852006a946a 14.0 landed
-
Avoid fragmentation of logical tapes when writing concurrently.
- 896ddf9b3cd7 13.0 cited
-
Logical Tape Set: use min heap for freelist.
- c02fdc922301 13.0 cited
-
Don't create "holes" in BufFiles, in the new logtape code.
- 7ac4a389a7db 10.0 cited