pgsql: Prefetch blocks during lazy vacuum's truncation scan

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prefetch blocks during lazy vacuum's truncation scan
Date: 2017-01-23 15:57:45
Message-ID: E1cVh05-0001N7-7n@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-01-23 16:07:40 pgsql: Fix memory leaks in libpqwalreceiver
Previous Message Tom Lane 2017-01-23 14:38:41 pgsql: Fix example plan in optimizer/README.