- Notifications
You must be signed in to change notification settings - Fork5
Commit1914c5e
committed
Avoid having vacuum set reltuples to 0 on non-empty relations in the
presence of page pins, which leads to serious estimation errors in theplanner. This particularly affects small heavily-accessed tables,especially where locking (e.g. from FK constraints) forces frequentvacuums for mxid cleanup.Fix by keeping separate track of pages whose live tuples were actuallycounted vs. pages that were only scanned for freezing purposes. Thus,reltuples can only be set to 0 if all pages of the relation wereactually counted.Backpatch to all supported versions.Per bug #14057 from Nicolas Baccelli, analyzed by me.Discussion:https://postgr.es/m/20160331103739.8956.94469@wrigleys.postgresql.org1 parent80824dd commit1914c5e
File tree
4 files changed
+119
-4
lines changed- src
- backend/commands
- test/isolation
- expected
- specs
4 files changed
+119
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
| 118 | + | |
118 | 119 |
| |
119 | 120 |
| |
120 | 121 |
| |
| |||
299 | 300 |
| |
300 | 301 |
| |
301 | 302 |
| |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
302 | 307 |
| |
303 | 308 |
| |
304 | 309 |
| |
| |||
308 | 313 |
| |
309 | 314 |
| |
310 | 315 |
| |
311 |
| - | |
| 316 | + | |
312 | 317 |
| |
313 | 318 |
| |
314 | 319 |
| |
| |||
496 | 501 |
| |
497 | 502 |
| |
498 | 503 |
| |
| 504 | + | |
499 | 505 |
| |
500 | 506 |
| |
501 | 507 |
| |
| |||
818 | 824 |
| |
819 | 825 |
| |
820 | 826 |
| |
| 827 | + | |
821 | 828 |
| |
822 | 829 |
| |
823 | 830 |
| |
| |||
1261 | 1268 |
| |
1262 | 1269 |
| |
1263 | 1270 |
| |
1264 |
| - | |
| 1271 | + | |
1265 | 1272 |
| |
1266 | 1273 |
| |
1267 | 1274 |
| |
| |||
1625 | 1632 |
| |
1626 | 1633 |
| |
1627 | 1634 |
| |
1628 |
| - | |
| 1635 | + | |
1629 | 1636 |
| |
1630 | 1637 |
| |
1631 | 1638 |
| |
|
Lines changed: 62 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
59 | 60 |
|
Lines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + |
0 commit comments
Comments
(0)