forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit056cc36
committed
pgstat: reduce timer overhead by leaving timer running.
Previously the timer was enabled whenever there were any pending stats afterexecuting a statement, just to then be disabled again when not idleanymore. That lead to an increase in GetCurrentTimestamp() calls from withintimeout.c compared to 14.To avoid that increase, leave the timer enabled until stats are reported,rather than until idle. The timer is only disabled once the pending stats havebeen reported.For me this fixes the increase in GetCurrentTimestamp() calls, there now arefewer calls in 15 than in 14, in the previously slowed down workload.While at it, also update assertion in pgstat_report_stat() to be more precise.Author: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.deBackpatch: 15-1 parent67b2670 commit056cc36
2 files changed
+32
-18
lines changedLines changed: 31 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3371 | 3371 |
| |
3372 | 3372 |
| |
3373 | 3373 |
| |
3374 |
| - | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
3375 | 3380 |
| |
3376 |
| - | |
3377 |
| - | |
3378 | 3381 |
| |
3379 | 3382 |
| |
3380 | 3383 |
| |
| |||
4050 | 4053 |
| |
4051 | 4054 |
| |
4052 | 4055 |
| |
4053 |
| - | |
4054 | 4056 |
| |
4055 | 4057 |
| |
4056 | 4058 |
| |
| |||
4427 | 4429 |
| |
4428 | 4430 |
| |
4429 | 4431 |
| |
4430 |
| - | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
| 4437 | + | |
| 4438 | + | |
| 4439 | + | |
| 4440 | + | |
| 4441 | + | |
| 4442 | + | |
| 4443 | + | |
| 4444 | + | |
4431 | 4445 |
| |
4432 | 4446 |
| |
4433 | 4447 |
| |
4434 |
| - | |
4435 |
| - | |
4436 |
| - | |
| 4448 | + | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
4437 | 4457 |
| |
4438 | 4458 |
| |
4439 | 4459 |
| |
| |||
4469 | 4489 |
| |
4470 | 4490 |
| |
4471 | 4491 |
| |
4472 |
| - | |
4473 |
| - | |
4474 |
| - | |
4475 |
| - | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
4476 | 4495 |
| |
4477 | 4496 |
| |
4478 | 4497 |
| |
| |||
4487 | 4506 |
| |
4488 | 4507 |
| |
4489 | 4508 |
| |
4490 |
| - | |
4491 |
| - | |
4492 |
| - | |
4493 |
| - | |
4494 |
| - | |
4495 | 4509 |
| |
4496 | 4510 |
| |
4497 | 4511 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
571 | 571 |
| |
572 | 572 |
| |
573 | 573 |
| |
574 |
| - | |
| 574 | + | |
575 | 575 |
| |
576 | 576 |
| |
577 | 577 |
| |
|
0 commit comments
Comments
(0)