forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd088ba5
committed
nbtree: Allocate new pages in separate function.
Split nbtree's _bt_getbuf function is two: code that read locks or writelocks existing pages remains in _bt_getbuf, while code that deals withallocating new pages is moved to a new, dedicated function called_bt_allocbuf. This simplifies most _bt_getbuf callers, since it is nolonger necessary for them to pass a heaprel argument. Many of thechanges to nbtree from commit61b313e can be reverted. This minimizesthe divergence between HEAD/PostgreSQL 16 and earlier release branches._bt_allocbuf replaces the previous nbtree idiom of passing P_NEW to_bt_getbuf. There are only 3 affected call sites, all of which continueto pass a heaprel for recovery conflict purposes. Note that nbtree'suse of P_NEW was superficial; nbtree never actually relied on the P_NEWcode paths in bufmgr.c, so this change is strictly mechanical.GiST already took the same approach; it has a dedicated function forallocating new pages called gistNewBuffer(). That factor allowed commit61b313e to make much more targeted changes to GiST.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://postgr.es/m/CAH2-Wz=8Z9qY58bjm_7TAHgtW6RzZ5Ke62q5emdCEy9BAzwhmg@mail.gmail.com1 parentfe879ae commitd088ba5
File tree
12 files changed
+269
-255
lines changed- contrib/amcheck
- src
- backend
- access
- heap
- nbtree
- optimizer/util
- utils/sort
- include
- access
- utils
12 files changed
+269
-255
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
335 | | - | |
| 334 | + | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
| |||
1259 | 1258 | | |
1260 | 1259 | | |
1261 | 1260 | | |
1262 | | - | |
| 1261 | + | |
1263 | 1262 | | |
1264 | 1263 | | |
1265 | 1264 | | |
| |||
1769 | 1768 | | |
1770 | 1769 | | |
1771 | 1770 | | |
1772 | | - | |
| 1771 | + | |
1773 | 1772 | | |
1774 | 1773 | | |
1775 | 1774 | | |
| |||
2682 | 2681 | | |
2683 | 2682 | | |
2684 | 2683 | | |
2685 | | - | |
| 2684 | + | |
2686 | 2685 | | |
2687 | 2686 | | |
2688 | 2687 | | |
| |||
2695 | 2694 | | |
2696 | 2695 | | |
2697 | 2696 | | |
2698 | | - | |
| 2697 | + | |
2699 | 2698 | | |
2700 | 2699 | | |
2701 | 2700 | | |
| |||
3134 | 3133 | | |
3135 | 3134 | | |
3136 | 3135 | | |
3137 | | - | |
| 3136 | + | |
3138 | 3137 | | |
3139 | 3138 | | |
3140 | 3139 | | |
3141 | | - | |
| 3140 | + | |
3142 | 3141 | | |
3143 | 3142 | | |
3144 | 3143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
| 734 | + | |
740 | 735 | | |
741 | | - | |
| 736 | + | |
742 | 737 | | |
743 | 738 | | |
744 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
1024 | 1024 | | |
1025 | 1025 | | |
1026 | 1026 | | |
1027 | | - | |
| 1027 | + | |
| 1028 | + | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
1031 | 1032 | | |
1032 | 1033 | | |
1033 | 1034 | | |
| 1035 | + | |
1034 | 1036 | | |
1035 | 1037 | | |
1036 | 1038 | | |
| |||
1145 | 1147 | | |
1146 | 1148 | | |
1147 | 1149 | | |
1148 | | - | |
| 1150 | + | |
1149 | 1151 | | |
1150 | 1152 | | |
1151 | 1153 | | |
| |||
1250 | 1252 | | |
1251 | 1253 | | |
1252 | 1254 | | |
1253 | | - | |
| 1255 | + | |
1254 | 1256 | | |
1255 | 1257 | | |
1256 | 1258 | | |
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
1260 | | - | |
| 1262 | + | |
1261 | 1263 | | |
1262 | 1264 | | |
1263 | 1265 | | |
| |||
1421 | 1423 | | |
1422 | 1424 | | |
1423 | 1425 | | |
1424 | | - | |
| 1426 | + | |
1425 | 1427 | | |
1426 | 1428 | | |
1427 | 1429 | | |
| |||
1715 | 1717 | | |
1716 | 1718 | | |
1717 | 1719 | | |
1718 | | - | |
| 1720 | + | |
1719 | 1721 | | |
1720 | 1722 | | |
1721 | 1723 | | |
| |||
1888 | 1890 | | |
1889 | 1891 | | |
1890 | 1892 | | |
1891 | | - | |
| 1893 | + | |
1892 | 1894 | | |
1893 | 1895 | | |
1894 | 1896 | | |
| |||
2102 | 2104 | | |
2103 | 2105 | | |
2104 | 2106 | | |
| 2107 | + | |
| 2108 | + | |
2105 | 2109 | | |
2106 | 2110 | | |
2107 | 2111 | | |
| |||
2121 | 2125 | | |
2122 | 2126 | | |
2123 | 2127 | | |
2124 | | - | |
2125 | | - | |
| 2128 | + | |
| 2129 | + | |
2126 | 2130 | | |
2127 | 2131 | | |
2128 | 2132 | | |
| |||
2161 | 2165 | | |
2162 | 2166 | | |
2163 | 2167 | | |
2164 | | - | |
2165 | | - | |
| 2168 | + | |
2166 | 2169 | | |
2167 | 2170 | | |
2168 | 2171 | | |
| |||
2230 | 2233 | | |
2231 | 2234 | | |
2232 | 2235 | | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
2233 | 2239 | | |
2234 | 2240 | | |
2235 | 2241 | | |
| |||
2243 | 2249 | | |
2244 | 2250 | | |
2245 | 2251 | | |
| 2252 | + | |
2246 | 2253 | | |
2247 | 2254 | | |
2248 | | - | |
| 2255 | + | |
2249 | 2256 | | |
2250 | 2257 | | |
2251 | 2258 | | |
| |||
2257 | 2264 | | |
2258 | 2265 | | |
2259 | 2266 | | |
2260 | | - | |
| 2267 | + | |
2261 | 2268 | | |
2262 | 2269 | | |
2263 | 2270 | | |
| |||
2323 | 2330 | | |
2324 | 2331 | | |
2325 | 2332 | | |
2326 | | - | |
| 2333 | + | |
2327 | 2334 | | |
2328 | 2335 | | |
2329 | 2336 | | |
| 2337 | + | |
2330 | 2338 | | |
2331 | 2339 | | |
2332 | 2340 | | |
| |||
2415 | 2423 | | |
2416 | 2424 | | |
2417 | 2425 | | |
2418 | | - | |
| 2426 | + | |
2419 | 2427 | | |
2420 | 2428 | | |
2421 | 2429 | | |
| |||
2433 | 2441 | | |
2434 | 2442 | | |
2435 | 2443 | | |
2436 | | - | |
| 2444 | + | |
2437 | 2445 | | |
2438 | 2446 | | |
2439 | 2447 | | |
| |||
2459 | 2467 | | |
2460 | 2468 | | |
2461 | 2469 | | |
2462 | | - | |
| 2470 | + | |
2463 | 2471 | | |
2464 | 2472 | | |
2465 | 2473 | | |
2466 | 2474 | | |
2467 | | - | |
| 2475 | + | |
2468 | 2476 | | |
2469 | 2477 | | |
2470 | 2478 | | |
| |||
0 commit comments
Comments
(0)