forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0074919
committed
Fix mesurement of elapsed time during truncating heap in VACUUM.
VACUUM may truncate heap in several batches. The activity reportis logged for each batch, and contains the number of pages in the tablebefore and after the truncation, and also the elapsed time duringthe truncation. Previously the elapsed time reported in each batch wasthe total elapsed time since starting the truncation until finishingeach batch. For example, if the truncation was processed dividing intothree batches, the second batch reported the accumulated time elapsedduring both first and second batches. This is strange and confusingbecause the number of pages in the table reported together is nottotal. Instead, each batch should report the time elapsed duringonly that batch.The cause of this issue was that the resource usage snapshot wasinitialized only at the beginning of the truncation and was neverreset later. This commit fixes the issue by changing VACUUM so thatthe resource usage snapshot is reset at each batch.Back-patch to all supported branches.Reported-by: Tatsuhito KasaharaAuthor: Tatsuhito KasaharaReviewed-by: Masahiko Sawada, Fujii MasaoDiscussion:https://postgr.es/m/CAP0=ZVJsf=NvQuy+QXQZ7B=ZVLoDV_JzsVC1FRsF1G18i3zMGg@mail.gmail.com1 parente2e0219 commit0074919
1 file changed
+4
-3
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2439 | 2439 |
| |
2440 | 2440 |
| |
2441 | 2441 |
| |
2442 |
| - | |
2443 | 2442 |
| |
2444 | 2443 |
| |
2445 |
| - | |
2446 |
| - | |
2447 | 2444 |
| |
2448 | 2445 |
| |
2449 | 2446 |
| |
| |||
2453 | 2450 |
| |
2454 | 2451 |
| |
2455 | 2452 |
| |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
2456 | 2457 |
| |
2457 | 2458 |
| |
2458 | 2459 |
| |
|
0 commit comments
Comments
(0)