Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2973b1c

Browse files
committed
Lower bounds related to pgstats kinds
This commit changes stats kinds to have the following bounds, makingtheir handling in core cheaper by default:- PGSTAT_KIND_CUSTOM_MIN 128 -> 24- PGSTAT_KIND_MAX 256 -> 32The original numbers were rather high, and showed an impact onperformance in pgstat_report_stat() for the case of simple queries withits early-exit path if there are no pending statistics to flush. Thislogic will be improved more in a follow-up commit to bring theperformance of pgstat_report_stat() on par with v17 and older versions.Lowering the bounds is a change worth doing on its own, independently ofthe other improvement.These new numbers should be enough to leave some room for the followingyears for built-in and custom stats kinds, with stable ID numbers. Atleast that should be enough to start with this facility for extensiondevelopers. It can be always increased in the tree depending on therequirements wanted.Per discussion with Andres Freund and Bertrand Drouvot.Discussion:https://postgr.es/m/eb224uegsga2hgq7dfq3ps5cduhpqej7ir2hjxzzozjthrekx5@dysei6buqtheBackpatch-through: 18
1 parent33f74b8 commit2973b1c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎src/include/utils/pgstat_kind.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/* Range of IDs allowed, for built-in and custom kinds */
2020
#definePGSTAT_KIND_MIN1/* Minimum ID allowed */
21-
#definePGSTAT_KIND_MAX256/* Maximum ID allowed */
21+
#definePGSTAT_KIND_MAX32/* Maximum ID allowed */
2222

2323
/* use 0 for INVALID, to catch zero-initialized data */
2424
#definePGSTAT_KIND_INVALID 0
@@ -46,7 +46,7 @@
4646
/* Custom stats kinds */
4747

4848
/* Range of IDs allowed for custom stats kinds */
49-
#definePGSTAT_KIND_CUSTOM_MIN128
49+
#definePGSTAT_KIND_CUSTOM_MIN24
5050
#definePGSTAT_KIND_CUSTOM_MAXPGSTAT_KIND_MAX
5151
#definePGSTAT_KIND_CUSTOM_SIZE(PGSTAT_KIND_CUSTOM_MAX - PGSTAT_KIND_CUSTOM_MIN + 1)
5252

@@ -55,7 +55,7 @@
5555
* development and have not reserved their own unique kind ID yet. See:
5656
* https://wiki.postgresql.org/wiki/CustomCumulativeStats
5757
*/
58-
#definePGSTAT_KIND_EXPERIMENTAL128
58+
#definePGSTAT_KIND_EXPERIMENTAL24
5959

6060
staticinlinebool
6161
pgstat_is_kind_builtin(PgStat_Kindkind)

‎src/test/modules/injection_points/injection_stats.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static const PgStat_KindInfo injection_stats = {
5959
/*
6060
* Kind ID reserved for statistics of injection points.
6161
*/
62-
#definePGSTAT_KIND_INJECTION129
62+
#definePGSTAT_KIND_INJECTION25
6363

6464
/* Track if stats are loaded */
6565
staticboolinj_stats_loaded= false;

‎src/test/modules/injection_points/injection_stats_fixed.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static const PgStat_KindInfo injection_stats_fixed = {
6464
/*
6565
* Kind ID reserved for statistics of injection points.
6666
*/
67-
#definePGSTAT_KIND_INJECTION_FIXED130
67+
#definePGSTAT_KIND_INJECTION_FIXED26
6868

6969
/* Track if fixed-numbered stats are loaded */
7070
staticboolinj_fixed_loaded= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp