forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf5bc741
committed
Make GEQO's planning deterministic by having it start from a predictable
random number seed each time. This is how it used to work years ago, butwe got rid of the seed reset because it was resetting the main random()sequence and thus having undesirable effects on the rest of the system.To fix, establish a private random number state for each execution ofgeqo(), and initialize the state using the new GUC variable geqo_seed.People who want to experiment with different random searches can do soby changing geqo_seed, but you'll always get the same plan for the samevalue of geqo_seed (if holding all other planner inputs constant, of course).The new state is kept in PlannerInfo by adding a "void *" field reservedfor use by join_search hooks. Most of the rather bulky code changes inthis commit are just arranging to pass PlannerInfo around to all the GEQOfunctions (many of which formerly didn't receive it).Andres Freund, with some editorialization by Tom1 parentc43feef commitf5bc741
File tree
27 files changed
+305
-202
lines changed- doc/src/sgml
- src
- backend
- optimizer/geqo
- utils/misc
- include
- nodes
- optimizer
27 files changed
+305
-202
lines changedLines changed: 18 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
2149 | 2149 |
| |
2150 | 2150 |
| |
2151 | 2151 |
| |
2152 |
| - | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
2153 | 2169 |
| |
2154 | 2170 |
| |
2155 | 2171 |
| |
|
Lines changed: 12 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 |
| - | |
92 |
| - | |
| 91 | + | |
93 | 92 |
| |
94 | 93 |
| |
95 | 94 |
| |
| |||
116 | 115 |
| |
117 | 116 |
| |
118 | 117 |
| |
119 |
| - | |
| 118 | + | |
120 | 119 |
| |
121 | 120 |
| |
122 | 121 |
| |
| |||
260 | 259 |
| |
261 | 260 |
| |
262 | 261 |
| |
263 |
| - | |
264 |
| - | |
265 |
| - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 |
| |
267 | 270 |
| |
268 | 271 |
| |
| |||
330 | 333 |
| |
331 | 334 |
| |
332 | 335 |
| |
333 |
| - | |
| 336 | + | |
334 | 337 |
| |
335 | 338 |
| |
336 | 339 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
| 46 | + | |
46 | 47 |
| |
47 | 48 |
| |
48 | 49 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
| 47 | + | |
| 48 | + | |
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
| |||
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
65 |
| - | |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
|
Lines changed: 26 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
40 |
| - | |
41 |
| - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 |
| |
43 |
| - | |
| 43 | + | |
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
| 73 | + | |
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
| 93 | + | |
93 | 94 |
| |
94 | 95 |
| |
95 | 96 |
| |
| |||
121 | 122 |
| |
122 | 123 |
| |
123 | 124 |
| |
124 |
| - | |
125 |
| - | |
| 125 | + | |
| 126 | + | |
126 | 127 |
| |
127 |
| - | |
128 |
| - | |
| 128 | + | |
| 129 | + | |
129 | 130 |
| |
130 | 131 |
| |
131 | 132 |
| |
| |||
147 | 148 |
| |
148 | 149 |
| |
149 | 150 |
| |
150 |
| - | |
| 151 | + | |
151 | 152 |
| |
152 | 153 |
| |
153 | 154 |
| |
| |||
189 | 190 |
| |
190 | 191 |
| |
191 | 192 |
| |
192 |
| - | |
| 193 | + | |
193 | 194 |
| |
194 | 195 |
| |
195 | 196 |
| |
196 | 197 |
| |
197 |
| - | |
198 |
| - | |
| 198 | + | |
| 199 | + | |
199 | 200 |
| |
200 | 201 |
| |
201 | 202 |
| |
| |||
204 | 205 |
| |
205 | 206 |
| |
206 | 207 |
| |
207 |
| - | |
| 208 | + | |
208 | 209 |
| |
209 | 210 |
| |
210 | 211 |
| |
211 | 212 |
| |
212 |
| - | |
| 213 | + | |
213 | 214 |
| |
214 | 215 |
| |
215 | 216 |
| |
216 | 217 |
| |
217 | 218 |
| |
218 |
| - | |
| 219 | + | |
219 | 220 |
| |
220 | 221 |
| |
221 | 222 |
| |
| |||
235 | 236 |
| |
236 | 237 |
| |
237 | 238 |
| |
238 |
| - | |
| 239 | + | |
239 | 240 |
| |
240 | 241 |
| |
241 | 242 |
| |
| |||
277 | 278 |
| |
278 | 279 |
| |
279 | 280 |
| |
280 |
| - | |
| 281 | + | |
281 | 282 |
| |
282 | 283 |
| |
283 | 284 |
| |
| |||
340 | 341 |
| |
341 | 342 |
| |
342 | 343 |
| |
343 |
| - | |
| 344 | + | |
344 | 345 |
| |
345 | 346 |
| |
346 | 347 |
| |
| |||
368 | 369 |
| |
369 | 370 |
| |
370 | 371 |
| |
371 |
| - | |
| 372 | + | |
372 | 373 |
| |
373 | 374 |
| |
374 | 375 |
| |
| |||
401 | 402 |
| |
402 | 403 |
| |
403 | 404 |
| |
404 |
| - | |
| 405 | + | |
405 | 406 |
| |
406 | 407 |
| |
407 | 408 |
| |
| |||
423 | 424 |
| |
424 | 425 |
| |
425 | 426 |
| |
426 |
| - | |
| 427 | + | |
427 | 428 |
| |
428 | 429 |
| |
429 | 430 |
| |
|
0 commit comments
Comments
(0)