Commit 7e26e02
committed
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.com1 parent 3c82146 commit 7e26e02
1 file changed
+31
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| |||
1826 | 1832 | | |
1827 | 1833 | | |
1828 | 1834 | | |
| 1835 | + | |
1829 | 1836 | | |
1830 | 1837 | | |
1831 | 1838 | | |
1832 | 1839 | | |
1833 | 1840 | | |
1834 | | - | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
1835 | 1847 | | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1836 | 1851 | | |
1837 | 1852 | | |
1838 | 1853 | | |
| |||
1882 | 1897 | | |
1883 | 1898 | | |
1884 | 1899 | | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
1885 | 1915 | | |
1886 | 1916 | | |
1887 | 1917 | | |
| |||
0 commit comments