forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc037471
committed
pgstat: Track time of the last scan of a relation
It can be useful to know when a relation has last been used, e.g., whenevaluating whether an index is still required. It was already possible toinfer the time of the last usage by tracking, e.g.,pg_stat_all_indexes.idx_scan over time. But far from everybody does so.To make it easier to detect the last time a relation has been scanned, trackthat time in each relation's pgstat entry. To minimize overhead a) thetimestamp is updated only when the backend pending stats entry is flushed toshared stats b) the last transaction's stop timestamp is used as thetimestamp.Bumps catalog and stats format versions.Author: Dave Page <dpage@pgadmin.org>Reviewed-by: Andres Freund <andres@anarazel.de>Reviewed-by: Bruce Momjian <bruce@momjian.us>Reviewed-by: Vik Fearing <vik@postgresfriends.org>Discussion:https://postgr.es/m/CA+OCxozrVHNFVEPkweUHMZje+t1tfY816d9MZYc6eZwOOusOaQ@mail.gmail.com1 parent309b2cf commitc037471
File tree
10 files changed
+356
-2
lines changed- doc/src/sgml
- src
- backend
- catalog
- utils
- activity
- adt
- include
- catalog
- test/regress
- expected
- sql
10 files changed
+356
-2
lines changedLines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4385 | 4385 |
| |
4386 | 4386 |
| |
4387 | 4387 |
| |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
4388 | 4398 |
| |
4389 | 4399 |
| |
4390 | 4400 |
| |
| |||
4403 | 4413 |
| |
4404 | 4414 |
| |
4405 | 4415 |
| |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
4406 | 4426 |
| |
4407 | 4427 |
| |
4408 | 4428 |
| |
| |||
4654 | 4674 |
| |
4655 | 4675 |
| |
4656 | 4676 |
| |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
4657 | 4687 |
| |
4658 | 4688 |
| |
4659 | 4689 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
656 | 656 |
| |
657 | 657 |
| |
658 | 658 |
| |
| 659 | + | |
659 | 660 |
| |
660 | 661 |
| |
| 662 | + | |
661 | 663 |
| |
662 | 664 |
| |
663 | 665 |
| |
| |||
774 | 776 |
| |
775 | 777 |
| |
776 | 778 |
| |
| 779 | + | |
777 | 780 |
| |
778 | 781 |
| |
779 | 782 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
789 | 789 |
| |
790 | 790 |
| |
791 | 791 |
| |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
792 | 798 |
| |
793 | 799 |
| |
794 | 800 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 |
| |
56 | 69 |
| |
57 | 70 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5252 | 5252 |
| |
5253 | 5253 |
| |
5254 | 5254 |
| |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
5255 | 5259 |
| |
5256 | 5260 |
| |
5257 | 5261 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
| 245 | + | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| |||
354 | 354 |
| |
355 | 355 |
| |
356 | 356 |
| |
| 357 | + | |
357 | 358 |
| |
358 | 359 |
| |
359 | 360 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1763 | 1763 |
| |
1764 | 1764 |
| |
1765 | 1765 |
| |
| 1766 | + | |
1766 | 1767 |
| |
1767 | 1768 |
| |
1768 | 1769 |
| |
| |||
1774 | 1775 |
| |
1775 | 1776 |
| |
1776 | 1777 |
| |
| 1778 | + | |
1777 | 1779 |
| |
1778 | 1780 |
| |
| 1781 | + | |
1779 | 1782 |
| |
1780 | 1783 |
| |
1781 | 1784 |
| |
| |||
2107 | 2110 |
| |
2108 | 2111 |
| |
2109 | 2112 |
| |
| 2113 | + | |
2110 | 2114 |
| |
2111 | 2115 |
| |
2112 | 2116 |
| |
| |||
2115 | 2119 |
| |
2116 | 2120 |
| |
2117 | 2121 |
| |
| 2122 | + | |
2118 | 2123 |
| |
2119 | 2124 |
| |
| 2125 | + | |
2120 | 2126 |
| |
2121 | 2127 |
| |
2122 | 2128 |
| |
| |||
2151 | 2157 |
| |
2152 | 2158 |
| |
2153 | 2159 |
| |
| 2160 | + | |
2154 | 2161 |
| |
2155 | 2162 |
| |
2156 | 2163 |
| |
| |||
2159 | 2166 |
| |
2160 | 2167 |
| |
2161 | 2168 |
| |
| 2169 | + | |
2162 | 2170 |
| |
2163 | 2171 |
| |
| 2172 | + | |
2164 | 2173 |
| |
2165 | 2174 |
| |
2166 | 2175 |
| |
|
0 commit comments
Comments
(0)