forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5e39f06
committed
Move bootstrap-time lookup of regproc OIDs into genbki.pl.
Formerly, the bootstrap backend looked up the OIDs corresponding tonames in regproc catalog entries using brute-force searches of pg_proc.It was somewhat remarkable that that worked at all, since it was usedwhile populating other pretty-fundamental catalogs like pg_operator.And it was also quite slow, and getting slower as pg_proc gets bigger.This patch moves the lookup work into genbki.pl, so that the values inpostgres.bki for regproc columns are always numeric OIDs, an optionthat regprocin() already supported. Perl isn't the world's speediestlanguage, so this about doubles the time needed to run genbki.pl (from0.3 to 0.6 sec on my machine). But we only do that at most once perbuild. The time needed to run initdb drops significantly --- on mymachine, initdb --no-sync goes from 1.8 to 1.3 seconds. So this isa small net win even for just one initdb per build, and it becomesquite a nice win for test sequences requiring many initdb runs.Strip out the now-dead code for brute-force catalog searching inregprocin. We'd also cargo-culted similar logic into regoperinand some (not all) of the other reg*in functions. That is alldead code too since we currently have no need to load such valuesduring bootstrap. I removed it all, reasoning that if we everneed such functionality it'd be much better to do it in a similarway to this patch.There might be some simplifications possible in the backend now thatregprocin doesn't require doing catalog reads so early in bootstrap.I've not looked into that, though.Andreas Karlsson, with some small adjustments by meDiscussion:https://postgr.es/m/30896.1492006367@sss.pgh.pa.us1 parenta9254e6 commit5e39f06
File tree
4 files changed
+120
-219
lines changed- src/backend
- catalog
- utils
- adt
4 files changed
+120
-219
lines changedLines changed: 28 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + | |
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
219 | 241 |
| |
220 | 242 |
| |
221 | 243 |
| |
| |||
229 | 251 |
| |
230 | 252 |
| |
231 | 253 |
| |
232 |
| - | |
| 254 | + | |
233 | 255 |
| |
234 | 256 |
| |
235 | 257 |
| |
| 258 | + | |
236 | 259 |
| |
237 | 260 |
| |
238 | 261 |
| |
239 |
| - | |
240 |
| - | |
241 |
| - | |
| 262 | + | |
242 | 263 |
| |
243 | 264 |
| |
244 | 265 |
| |
245 |
| - | |
246 |
| - | |
| 266 | + | |
| 267 | + | |
247 | 268 |
| |
248 | 269 |
| |
249 | 270 |
|
Lines changed: 42 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| 105 | + | |
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
| |||
160 | 161 |
| |
161 | 162 |
| |
162 | 163 |
| |
163 |
| - | |
164 |
| - | |
165 |
| - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
166 | 200 |
| |
167 | 201 |
| |
168 | 202 |
| |
169 | 203 |
| |
170 |
| - | |
| 204 | + | |
171 | 205 |
| |
172 |
| - | |
173 | 206 |
| |
174 | 207 |
| |
175 | 208 |
| |
176 | 209 |
| |
177 | 210 |
| |
178 |
| - | |
| 211 | + | |
| 212 | + | |
179 | 213 |
| |
180 |
| - | |
| 214 | + | |
181 | 215 |
| |
182 | 216 |
| |
183 | 217 |
| |
| |||
426 | 460 |
| |
427 | 461 |
| |
428 | 462 |
| |
429 |
| - | |
| 463 | + | |
430 | 464 |
| |
431 | 465 |
| |
432 | 466 |
| |
|
Lines changed: 8 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
71 | 64 |
| |
72 | 65 |
| |
73 | 66 |
| |
74 |
| - | |
| 67 | + | |
75 | 68 |
| |
76 | 69 |
| |
77 | 70 |
| |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
85 | 75 |
| |
86 | 76 |
| |
87 | 77 |
| |
|
0 commit comments
Comments
(0)