forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9cd00c4
committed
Checkpoint sorting and balancing.
Up to now checkpoints were written in the order they're in theBufferDescriptors. That's nearly random in a lot of cases, whichperforms badly on rotating media, but even on SSDs it causes slowdowns.To avoid that, sort checkpoints before writing them out. We currentlysort by tablespace, relfilenode, fork and block number.One of the major reasons that previously wasn't done, was fear ofimbalance between tablespaces. To address that balance writes betweentablespaces.The other prime concern was that the relatively large allocation to sortthe buffers in might fail, preventing checkpoints from happening. Thuspre-allocate the required memory in shared memory, at server startup.This particularly makes it more efficient to have checkpoint flushingenabled, because that'll often result in a lot of writes that can becoalesced into one flush.Discussion: alpine.DEB.2.10.1506011320000.28433@stoAuthor: Fabien Coelho and Andres Freund1 parent428b1d6 commit9cd00c4
File tree
5 files changed
+277
-44
lines changed- src
- backend/storage/buffer
- include/storage
- tools/pgindent
5 files changed
+277
-44
lines changedLines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
267 | 267 |
| |
268 | 268 |
| |
269 | 269 |
| |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 | 270 |
| |
276 | 271 |
| |
277 | 272 |
| |
|
Lines changed: 19 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
73 |
| - | |
| 74 | + | |
| 75 | + | |
74 | 76 |
| |
75 | 77 |
| |
76 | 78 |
| |
| |||
104 | 106 |
| |
105 | 107 |
| |
106 | 108 |
| |
107 |
| - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 |
| |
109 | 122 |
| |
110 |
| - | |
| 123 | + | |
111 | 124 |
| |
112 | 125 |
| |
113 | 126 |
| |
| |||
190 | 203 |
| |
191 | 204 |
| |
192 | 205 |
| |
| 206 | + | |
| 207 | + | |
| 208 | + | |
193 | 209 |
| |
194 | 210 |
|
0 commit comments
Comments
(0)