- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitbf01e1b
committed
Refactor some code related to transaction-level statistics for relations
This commit refactors find_tabstat_entry() so as transaction countersfor inserted, updated and deleted tuples are included in the resultreturned. If a shared entry is found for a relation, its result is nowa copy of the PgStat_TableStatus entry retrieved from shared memory.This idea has been proposed by Andres Freund.While on it, the following SQL functions, used in system views, arerefactored with macros, in the same spirit as83a1a1b, reducing theamount of code:- pg_stat_get_xact_tuples_deleted()- pg_stat_get_xact_tuples_inserted()- pg_stat_get_xact_tuples_updated()There is now only one caller of find_tabstat_entry() in the tree.Author: Bertrand DrouvotDiscussion:https://postgr.es/m/b9e1f543-ee93-8168-d530-d961708ad9d3@gmail.com1 parent06be01e commitbf01e1b
File tree
2 files changed
+42
-64
lines changed- src/backend/utils
- activity
- adt
2 files changed
+42
-64
lines changedLines changed: 36 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
478 | 478 |
| |
479 | 479 |
| |
480 | 480 |
| |
481 |
| - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
482 | 486 |
| |
483 | 487 |
| |
484 | 488 |
| |
485 | 489 |
| |
486 | 490 |
| |
| 491 | + | |
| 492 | + | |
| 493 | + | |
487 | 494 |
| |
488 | 495 |
| |
489 | 496 |
| |
| 497 | + | |
490 | 498 |
| |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
491 | 525 |
| |
492 |
| - | |
493 |
| - | |
494 |
| - | |
| 526 | + | |
495 | 527 |
| |
496 | 528 |
| |
497 | 529 |
| |
|
Lines changed: 6 additions & 60 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1588 | 1588 |
| |
1589 | 1589 |
| |
1590 | 1590 |
| |
1591 |
| - | |
1592 |
| - | |
1593 |
| - | |
1594 |
| - | |
1595 |
| - | |
1596 |
| - | |
1597 |
| - | |
| 1591 | + | |
| 1592 | + | |
1598 | 1593 |
| |
1599 |
| - | |
1600 |
| - | |
1601 |
| - | |
1602 |
| - | |
1603 |
| - | |
1604 |
| - | |
1605 |
| - | |
1606 |
| - | |
1607 |
| - | |
| 1594 | + | |
| 1595 | + | |
1608 | 1596 |
| |
1609 |
| - | |
1610 |
| - | |
1611 |
| - | |
1612 |
| - | |
1613 |
| - | |
1614 |
| - | |
1615 |
| - | |
1616 |
| - | |
1617 |
| - | |
1618 |
| - | |
1619 |
| - | |
1620 |
| - | |
1621 |
| - | |
1622 |
| - | |
1623 |
| - | |
1624 |
| - | |
1625 |
| - | |
1626 |
| - | |
1627 |
| - | |
1628 |
| - | |
1629 |
| - | |
1630 |
| - | |
1631 |
| - | |
1632 |
| - | |
1633 |
| - | |
1634 |
| - | |
1635 |
| - | |
1636 |
| - | |
1637 |
| - | |
1638 |
| - | |
1639 |
| - | |
1640 |
| - | |
1641 |
| - | |
1642 |
| - | |
1643 |
| - | |
1644 |
| - | |
1645 |
| - | |
1646 |
| - | |
1647 |
| - | |
1648 |
| - | |
1649 |
| - | |
1650 |
| - | |
1651 |
| - | |
1652 |
| - | |
| 1597 | + | |
| 1598 | + | |
1653 | 1599 |
| |
1654 | 1600 |
| |
1655 | 1601 |
| |
|
0 commit comments
Comments
(0)