- Notifications
You must be signed in to change notification settings - Fork5
Commit603e153
committed
I don't like last minute patches before the final freeze, but I believe that
this one could be useful for people experiencing out-of-memory crashes whileexecuting queries which retrieve or use a very large number of tuples.The problem happens when storage is allocated for functions results used ina large query, for example: select upper(name) from big_table; select big_table.array[1] from big_table; select count(upper(name)) from big_table;This patch is a dirty hack that fixes the out-of-memory problem for the mostcommon cases, like the above ones. It is not the final solution for theproblem but it can work for some people, so I'm posting it.The patch should be safe because all changes are under #ifdef. Furthermorethe feature can be enabled or disabled at runtime by the `free_tuple_memory'options in the pg_options file. The option is disabled by default and mustbe explicitly enabled at runtime to have any effect.To enable the patch add the follwing line to Makefile.custom:CUSTOM_COPT += -DFREE_TUPLE_MEMORYTo enable the option at runtime add the following line to pg_option:free_tuple_memory=1Massimo1 parentbd470ba commit603e153
File tree
6 files changed
+111
-14
lines changed- src
- backend
- access/common
- executor
- utils
- misc
- mmgr
- include/utils
6 files changed
+111
-14
lines changedLines changed: 26 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 |
| |
31 | 36 |
| |
32 | 37 |
| |
| |||
93 | 98 |
| |
94 | 99 |
| |
95 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
96 | 104 |
| |
97 | 105 |
| |
98 | 106 |
| |
| |||
131 | 139 |
| |
132 | 140 |
| |
133 | 141 |
| |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
134 | 150 |
| |
135 | 151 |
| |
136 | 152 |
| |
| |||
147 | 163 |
| |
148 | 164 |
| |
149 | 165 |
| |
150 |
| - | |
151 |
| - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
152 | 175 |
| |
153 | 176 |
| |
154 | 177 |
| |
|
Lines changed: 47 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 |
| |
35 | 40 |
| |
36 | 41 |
| |
| |||
113 | 118 |
| |
114 | 119 |
| |
115 | 120 |
| |
116 |
| - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
117 | 124 |
| |
118 | 125 |
| |
119 | 126 |
| |
| |||
241 | 248 |
| |
242 | 249 |
| |
243 | 250 |
| |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
244 | 255 |
| |
245 | 256 |
| |
246 | 257 |
| |
| |||
293 | 304 |
| |
294 | 305 |
| |
295 | 306 |
| |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
296 | 332 |
| |
297 | 333 |
| |
298 | 334 |
| |
| |||
353 | 389 |
| |
354 | 390 |
| |
355 | 391 |
| |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
356 | 402 |
| |
357 | 403 |
| |
358 | 404 |
| |
|
Lines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 |
| |
77 | 80 |
| |
78 | 81 |
| |
| |||
404 | 407 |
| |
405 | 408 |
| |
406 | 409 |
| |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
411 | 414 |
| |
412 | 415 |
|
Lines changed: 19 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
289 | 289 |
| |
290 | 290 |
| |
291 | 291 |
| |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
292 | 310 |
| |
293 | 311 |
| |
294 | 312 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 |
| |
84 | 88 |
| |
85 | 89 |
| |
|
Lines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 |
| |
68 | 71 |
| |
69 | 72 |
| |
| |||
83 | 86 |
| |
84 | 87 |
| |
85 | 88 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 |
| |
91 | 94 |
|
0 commit comments
Comments
(0)