Thread: [COMMITTERS] pgsql: Prefetch blocks during lazy vacuum's truncation scan

[COMMITTERS] pgsql: Prefetch blocks during lazy vacuum's truncation scan

From
Alvaro Herrera
Date:
Prefetch blocks during lazy vacuum's truncation scan

Vacuum truncation scan can be sped up on rotating media by prefetching
blocks in forward direction.  That makes the blocks already present in
memory by the time they are needed, while also letting OS read-ahead
kick in.

The truncate scan has been measured to be five times faster than without
this patch (that was on a slow disk, but it shouldn't hurt on fast
disks.)

Author: Álvaro Herrera, loosely based on a submission by Claudio Freire
Discussion: https://postgr.es/m/CAGTBQpa6NFGO_6g_y_7zQx8L9GcHDSQKYdo1tGuh791z6PYgEg@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7e26e02eec90370dd222f35f00042f8188488ac4

Modified Files
--------------
src/backend/commands/vacuumlazy.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)