Commit e6d8069
committed
Make DROP DATABASE command generate less WAL records.
Previously DROP DATABASE generated as many XLOG_DBASE_DROP WAL records
as the number of tablespaces that the database to drop uses. This caused
the scans of shared_buffers as many times as the number of the tablespaces
during recovery because WAL replay of one XLOG_DBASE_DROP record needs
that full scan. This could make the recovery time longer especially
when shared_buffers is large.
This commit changes DROP DATABASE so that it generates only one
XLOG_DBASE_DROP record, and registers the information of all the tablespaces
into it. Then, WAL replay of XLOG_DBASE_DROP record needs full scan of
shared_buffers only once, and which may improve the recovery performance.
Author: Fujii Masao
Reviewed-by: Kirk Jamison, Simon Riggs
Discussion: https://postgr.es/m/CAHGQGwF8YwNH0ZaL+2wjZPkj+ji9UhC+Z4ScnG97WKtVY5L9iw@mail.gmail.com1 parent 30840c9 commit e6d8069
File tree
3 files changed
+56
-23
lines changed- src
- backend
- access/rmgrdesc
- commands
- include/commands
3 files changed
+56
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | | - | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
1414 | | - | |
| 1414 | + | |
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
| 1418 | + | |
1418 | 1419 | | |
1419 | 1420 | | |
1420 | 1421 | | |
| |||
1946 | 1947 | | |
1947 | 1948 | | |
1948 | 1949 | | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
1949 | 1955 | | |
1950 | 1956 | | |
1951 | 1957 | | |
| |||
1974 | 1980 | | |
1975 | 1981 | | |
1976 | 1982 | | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
1980 | 1986 | | |
1981 | | - | |
1982 | | - | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
1983 | 1994 | | |
1984 | | - | |
1985 | | - | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
1986 | 1999 | | |
1987 | | - | |
1988 | | - | |
1989 | | - | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
1990 | 2003 | | |
1991 | | - | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
1992 | 2013 | | |
1993 | 2014 | | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
1994 | 2018 | | |
1995 | 2019 | | |
1996 | 2020 | | |
| |||
2197 | 2221 | | |
2198 | 2222 | | |
2199 | 2223 | | |
2200 | | - | |
2201 | | - | |
| 2224 | + | |
2202 | 2225 | | |
2203 | 2226 | | |
2204 | 2227 | | |
| |||
2228 | 2251 | | |
2229 | 2252 | | |
2230 | 2253 | | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
2236 | 2265 | | |
2237 | 2266 | | |
2238 | 2267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments