forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4496020
committed
Avoid reltuples distortion in very small tables.
Consistently avoid trusting a sample of only one page at the point thatVACUUM determines a new reltuples for the target table (though only whenthe table is larger than a single page). This is follow-up work tocommit74388a1, which added a heuristic to prevent reltuples frombecoming distorted by successive VACUUM operations that each scan only asingle heap page (which was itself more or less a bugfix for an issue incommit44fa848, which simplified VACUUM's handling of scanned pages).The original bugfix commit did not account for certain remaining casesthat where not affected by its "2% of total relpages" heuristic. Thishappened with relations that are small enough that just one of its pagesexceeded the 2% threshold, yet still big enough for VACUUM to deemskipping most of its pages via the visibility map worthwhile. reltuplescould still become distorted over time with such a table, at least inscenarios where the VACUUM command is run repeatedly and without thetable itself ever changing.Author: Peter Geoghegan <pg@bowt.ie>Discussion:https://postgr.es/m/CAH2-Wzk7d4m3oEbEWkWQKd+gz-eD_peBvdXVk1a_KBygXadFeg@mail.gmail.comBackpatch: 15-, where the rules for scanned pages changed.1 parent4afe79b commit4496020
1 file changed
+10
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | 1237 | | |
1245 | 1238 | | |
1246 | 1239 | | |
1247 | 1240 | | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1253 | 1248 | | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
| 1249 | + | |
1258 | 1250 | | |
1259 | 1251 | | |
1260 | 1252 | | |
1261 | 1253 | | |
| 1254 | + | |
| 1255 | + | |
1262 | 1256 | | |
1263 | 1257 | | |
1264 | 1258 | | |
| |||
0 commit comments
Comments
(0)