forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit17f8ffa
committed
Fix REFRESH MATERIALIZED VIEW to report activity to the stats collector.
The non-concurrent code path for REFRESH MATERIALIZED VIEW failed toreport its updates to the stats collector. This is bad since it meansauto-analyze doesn't know there's any work to be done. Adjust it toreport the refresh as a table truncate followed by insertion of anappropriate number of rows.Since a matview could contain more than INT_MAX rows, change thesignature of pgstat_count_heap_insert() to accept an int64 rowcount.(The accumulator it's adding into is already int64, but existingcallers could not insert more than a small number of rows at once,so the argument had been declared just "int n".)This is surely a bug fix, but changing pgstat_count_heap_insert()'s APIseems too risky for the back branches. Given the lack of previouscomplaints, I'm not sure it's a big enough problem to justify a klugesolution that would avoid that. So, no back-patch, at least for now.Jim Mlodgenski, adjusted a bit by meDiscussion:https://postgr.es/m/CAB_5SRchSz7-WmdO5szdiknG8Oj_GGqJytrk1KRd11yhcMs1KQ@mail.gmail.com1 parent27f1f58 commit17f8ffa
3 files changed
+29
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
325 | | - | |
| 327 | + | |
326 | 328 | | |
327 | 329 | | |
328 | 330 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| 350 | + | |
348 | 351 | | |
349 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
350 | 364 | | |
351 | 365 | | |
352 | 366 | | |
| |||
360 | 374 | | |
361 | 375 | | |
362 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
363 | 382 | | |
364 | | - | |
| 383 | + | |
365 | 384 | | |
366 | 385 | | |
367 | 386 | | |
368 | 387 | | |
369 | 388 | | |
370 | 389 | | |
371 | 390 | | |
| 391 | + | |
372 | 392 | | |
373 | 393 | | |
374 | 394 | | |
| |||
406 | 426 | | |
407 | 427 | | |
408 | 428 | | |
| 429 | + | |
| 430 | + | |
409 | 431 | | |
410 | 432 | | |
411 | 433 | | |
412 | 434 | | |
413 | 435 | | |
414 | 436 | | |
415 | 437 | | |
| 438 | + | |
| 439 | + | |
416 | 440 | | |
417 | 441 | | |
418 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1803 | 1803 | | |
1804 | 1804 | | |
1805 | 1805 | | |
1806 | | - | |
| 1806 | + | |
1807 | 1807 | | |
1808 | 1808 | | |
1809 | 1809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
| 1259 | + | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
| |||
0 commit comments
Comments
(0)