Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward
Date
Msg-id 381756.1760998513@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward
List pgsql-hackers
I wrote:
> So for me, the proposed patch actually makes it 2X slower.

I went and tried this same test case on a 2024 Mac Mini M4 Pro.
Cutting to the chase:

HEAD:

$ time pg_restore -f /dev/null -t zedtable bench10000.dump

real    1m26.525s
user    0m0.364s
sys     0m6.806s

Patched:

$ time pg_restore -f /dev/null -t zedtable bench10000.dump

real    0m15.419s
user    0m0.279s
sys     0m8.224s

So on this hardware it *does* win (although maybe things would
be different for a parallel restore).  The patched pg_restore
takes just about the same amount of time as "cat", and iostat
shows both of them reaching a bit more than 6GB/s read speed.

My feeling at this point is that we'd probably drop the block
size test as irrelevant, and instead simply ignore ctx->hasSeek
within this loop if we think we're on a platform where that's
the right thing.  But how do we figure that out?

Not sure where we go from here, but clearly a bunch of research
is going to be needed to decide whether this is committable.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Dimitrios Apostolou
Date:
Subject: Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward
Next
From: Masahiko Sawada
Date:
Subject: Re: Logical Replication of sequences