Re: logtape.c stats don't account for unused "prefetched" block numbers

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-12T01:37:13Z
Lists: pgsql-hackers
On Fri, Sep 11, 2020 at 6:29 PM Peter Geoghegan <pg@bowt.ie> wrote:
> I'll probably close out this open item tomorrow. I need to think about
> it some more, but right now everything looks good. I think I'll
> probably end up pushing a commit with more explanatory comments.

That said, we still need to make sure that the preallocation
instrumentation for HashAggs-that-spill is sensible -- it has to
actually match the temp file size.

It would be awkward if we just used nBlocksWritten within
LogicalTapeSetBlocks() in the case where we didn't preallocate (or in
all cases). Not entirely sure what to do about that just yet.

-- 
Peter Geoghegan



Commits

  1. Change LogicalTapeSetBlocks() to use nBlocksWritten.

  2. HashAgg: release write buffers sooner by rewinding tape.

  3. logtape.c: do not preallocate for tapes when sorting

  4. Fix bogus MaxAllocSize check in logtape.c.

  5. Avoid fragmentation of logical tapes when writing concurrently.

  6. Logical Tape Set: use min heap for freelist.

  7. Don't create "holes" in BufFiles, in the new logtape code.