forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitda11977
committed
Reduce memory usage of tsvector type analyze function.
compute_tsvector_stats() detoasted and kept in memory every tsvector valuein the sample, but that can be a lot of memory. The original bug reportdescribed a case using over 10 gigabytes, with statistics target of 10000(the maximum).To fix, allocate a separate copy of just the lexemes that we keep around,and free the detoasted tsvector values as we go. This adds some palloc/pfreeoverhead, when you have a lot of distinct lexemes in the sample, but it'sbetter than running out of memory.Fixes bug #14654 reported by James C. Reviewed by Tom Lane. Backport toall supported versions.Discussion:https://www.postgresql.org/message-id/20170514200602.1451.46797@wrigleys.postgresql.org1 parentca793c5 commitda11977
1 file changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 235 | + | |
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| |||
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
276 | 282 | | |
277 | 283 | | |
278 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
279 | 289 | | |
280 | 290 | | |
281 | 291 | | |
| |||
447 | 457 | | |
448 | 458 | | |
449 | 459 | | |
| 460 | + | |
| 461 | + | |
450 | 462 | | |
451 | 463 | | |
452 | 464 | | |
| 465 | + | |
453 | 466 | | |
454 | 467 | | |
455 | 468 | | |
| |||
0 commit comments
Comments
(0)