forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1de58df
committed
Add page-level freezing to VACUUM.
Teach VACUUM to decide on whether or not to trigger freezing at thelevel of whole heap pages. Individual XIDs and MXIDs fields from tupleheaders now trigger freezing of whole pages, rather than independentlytriggering freezing of each individual tuple header field.Managing the cost of freezing over time now significantly influenceswhen and how VACUUM freezes. The overall amount of WAL written is thesingle most important freezing related cost, in general. Freezing eachpage's tuples together in batch allows VACUUM to take full advantage ofthe freeze plan WAL deduplication optimization added by commit9e54059.Also teach VACUUM to trigger page-level freezing whenever it detectsthat heap pruning generated an FPI. We'll have already written a largeamount of WAL just to do that much, so it's very likely a good idea toget freezing out of the way for the page early. This only happens incases where it will directly lead to marking the page all-frozen in thevisibility map.In most cases "freezing a page" removes all XIDs < OldestXmin, and allMXIDs < OldestMxact. It doesn't quite work that way in certain rarecases involving MultiXacts, though. It is convenient to define "freezethe page" in a way that gives FreezeMultiXactId the leeway to put offthe work of processing an individual tuple's xmax whenever it happens tobe a MultiXactId that would require an expensive second pass to processaggressively (allocating a new multi is especially worth avoiding here).FreezeMultiXactId is eager when processing is cheap (as it usually is),and lazy in the event of an individual multi that happens to requireexpensive second pass processing. This avoids regressions related toprocessing of multis that page-level freezing might otherwise cause.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Jeff Davis <pgsql@j-davis.com>Reviewed-By: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/CAH2-WzkFok_6EAHuK39GaW4FjEFQsY=3J0AAd6FXk93u-Xq3Fg@mail.gmail.com1 parent7a05425 commit1de58df
File tree
4 files changed
+463
-297
lines changed- doc/src/sgml
- src
- backend/access/heap
- include/access
4 files changed
+463
-297
lines changedLines changed: 5 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9194 | 9194 |
| |
9195 | 9195 |
| |
9196 | 9196 |
| |
9197 |
| - | |
9198 |
| - | |
9199 |
| - | |
| 9197 | + | |
| 9198 | + | |
| 9199 | + | |
9200 | 9200 |
| |
9201 | 9201 |
| |
9202 | 9202 |
| |
| |||
9274 | 9274 |
| |
9275 | 9275 |
| |
9276 | 9276 |
| |
9277 |
| - | |
9278 |
| - | |
9279 |
| - | |
| 9277 | + | |
| 9278 | + | |
9280 | 9279 |
| |
9281 | 9280 |
| |
9282 | 9281 |
| |
|
0 commit comments
Comments
(0)