forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac8bc3b
committed
Remove unnecessary relcache flushes after changing btree metapages.
These flushes were added in my commitd2896a9, which added the btreelogic that keeps a cached copy of the index metapage data in index relcacheentries. The idea was to ensure that other backends would promptly updatetheir cached copies after a change. However, this is not really necessary,since _bt_getroot() has adequate defenses against believing a stale rootpage link, and _bt_getrootheight() doesn't have to be 100% right.Moreover, if it were necessary, a relcache flush would be an unreliable wayto do it, since the sinval mechanism believes that relcache flush requestsrepresent transactional updates, and therefore discards them on transactionrollback. Therefore, we might as well drop these flush requests and savethe time to rebuild the whole relcache entry after a metapage change.If we ever try to support in-place truncation of btree indexes, it mightbe necessary to revisit this issue so that _bt_getroot() can't get caughtby trying to follow a metapage link to a page that no longer exists.A possible solution to that is to make use of an smgr, rather thanrelcache, inval request to force other backends to discard their cachedmetapages. But for the moment this is not worth pursuing.1 parent14aa601 commitac8bc3b
File tree
4 files changed
+14
-37
lines changed- src/backend/access/nbtree
4 files changed
+14
-37
lines changedLines changed: 11 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
438 | 438 |
| |
439 | 439 |
| |
440 | 440 |
| |
441 |
| - | |
442 |
| - | |
443 |
| - | |
444 |
| - | |
445 |
| - | |
446 |
| - | |
447 |
| - | |
448 |
| - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
449 | 452 |
| |
450 | 453 |
| |
451 | 454 |
| |
|
Lines changed: 1 addition & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 | 24 |
| |
26 | 25 |
| |
27 | 26 |
| |
| |||
868 | 867 |
| |
869 | 868 |
| |
870 | 869 |
| |
871 |
| - | |
| 870 | + | |
872 | 871 |
| |
873 |
| - | |
874 |
| - | |
875 |
| - | |
876 | 872 |
| |
877 |
| - | |
878 | 873 |
| |
879 | 874 |
| |
880 | 875 |
| |
| |||
1963 | 1958 |
| |
1964 | 1959 |
| |
1965 | 1960 |
| |
1966 |
| - | |
1967 |
| - | |
1968 |
| - | |
1969 |
| - | |
1970 | 1961 |
| |
1971 | 1962 |
| |
1972 | 1963 |
| |
|
Lines changed: 2 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
32 | 31 |
| |
33 | 32 |
| |
34 | 33 |
| |
| |||
246 | 245 |
| |
247 | 246 |
| |
248 | 247 |
| |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 | 248 |
| |
256 | 249 |
| |
257 | 250 |
| |
| |||
1545 | 1538 |
| |
1546 | 1539 |
| |
1547 | 1540 |
| |
1548 |
| - | |
| 1541 | + | |
1549 | 1542 |
| |
1550 |
| - | |
1551 |
| - | |
1552 | 1543 |
| |
1553 |
| - | |
| 1544 | + | |
1554 | 1545 |
| |
1555 | 1546 |
| |
1556 | 1547 |
| |
|
Lines changed: 0 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 | 151 |
| |
160 | 152 |
| |
161 | 153 |
| |
|
0 commit comments
Comments
(0)