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

Commit8b53277

Browse files
committed
Add regression test listing all the possible tuples in pg_stat_io
pg_stat_io returns a set of tuples based on a combination of threeproperties (BackendType, IOObject and IOContext) andpgstat_tracks_io_object() to decide if a BackendType should return atuple based on a pair made of an IOObject and an IOContext.This commit adds a regression test to track all the combinationssupported. This is useful to know which tuples are relevant when addinga new BackendType to the set or when touching pgstat_tracks_io_object(),and I have noticed while playing with this area that it is notcomplicated to break it without the regression tests noticing adifference in some cases.Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Discussion:https://postgr.es/m/Z8exfAehbVbEKXW5@paquier.xyz
1 parent9a8dd2c commit8b53277

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

‎src/test/regress/expected/stats.out

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,84 @@ SHOW track_counts; -- must be on
1111
on
1212
(1 row)
1313

14+
-- List of backend types, contexts and objects tracked in pg_stat_io.
15+
\a
16+
SELECT backend_type, object, context FROM pg_stat_io
17+
ORDER BY backend_type, object, context COLLATE "C";
18+
backend_type|object|context
19+
autovacuum launcher|relation|bulkread
20+
autovacuum launcher|relation|init
21+
autovacuum launcher|relation|normal
22+
autovacuum launcher|wal|init
23+
autovacuum launcher|wal|normal
24+
autovacuum worker|relation|bulkread
25+
autovacuum worker|relation|init
26+
autovacuum worker|relation|normal
27+
autovacuum worker|relation|vacuum
28+
autovacuum worker|wal|init
29+
autovacuum worker|wal|normal
30+
background worker|relation|bulkread
31+
background worker|relation|bulkwrite
32+
background worker|relation|init
33+
background worker|relation|normal
34+
background worker|relation|vacuum
35+
background worker|temp relation|normal
36+
background worker|wal|init
37+
background worker|wal|normal
38+
background writer|relation|init
39+
background writer|relation|normal
40+
background writer|wal|init
41+
background writer|wal|normal
42+
checkpointer|relation|init
43+
checkpointer|relation|normal
44+
checkpointer|wal|init
45+
checkpointer|wal|normal
46+
client backend|relation|bulkread
47+
client backend|relation|bulkwrite
48+
client backend|relation|init
49+
client backend|relation|normal
50+
client backend|relation|vacuum
51+
client backend|temp relation|normal
52+
client backend|wal|init
53+
client backend|wal|normal
54+
slotsync worker|relation|bulkread
55+
slotsync worker|relation|bulkwrite
56+
slotsync worker|relation|init
57+
slotsync worker|relation|normal
58+
slotsync worker|relation|vacuum
59+
slotsync worker|temp relation|normal
60+
slotsync worker|wal|init
61+
slotsync worker|wal|normal
62+
standalone backend|relation|bulkread
63+
standalone backend|relation|bulkwrite
64+
standalone backend|relation|init
65+
standalone backend|relation|normal
66+
standalone backend|relation|vacuum
67+
standalone backend|wal|init
68+
standalone backend|wal|normal
69+
startup|relation|bulkread
70+
startup|relation|bulkwrite
71+
startup|relation|init
72+
startup|relation|normal
73+
startup|relation|vacuum
74+
startup|wal|init
75+
startup|wal|normal
76+
walreceiver|wal|init
77+
walreceiver|wal|normal
78+
walsender|relation|bulkread
79+
walsender|relation|bulkwrite
80+
walsender|relation|init
81+
walsender|relation|normal
82+
walsender|relation|vacuum
83+
walsender|temp relation|normal
84+
walsender|wal|init
85+
walsender|wal|normal
86+
walsummarizer|wal|init
87+
walsummarizer|wal|normal
88+
walwriter|wal|init
89+
walwriter|wal|normal
90+
(71 rows)
91+
\a
1492
-- ensure that both seqscan and indexscan plans are allowed
1593
SET enable_seqscan TO on;
1694
SET enable_indexscan TO on;

‎src/test/regress/sql/stats.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
-- conditio sine qua non
99
SHOW track_counts;-- must be on
1010

11+
-- List of backend types, contexts and objects tracked in pg_stat_io.
12+
\a
13+
SELECT backend_type, object, contextFROM pg_stat_io
14+
ORDER BY backend_type, object, context COLLATE"C";
15+
\a
16+
1117
-- ensure that both seqscan and indexscan plans are allowed
1218
SET enable_seqscan TOon;
1319
SET enable_indexscan TOon;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp