Skip to content

queryid equals 0 for some wait events #93

Closed
@DmitryNFomin

Description

@DmitryNFomin

Good evening
I've noticed that for real client backend pids (not PG server processes) some wait events always have 0 in queryid column in all pg_wait_sampling views. So far I found that all IPC type events, SyncRep and WALWrite events have queryid = 0, for example

select event_type, event, queryid, count(*) from pg_wait_sampling_profile where event_type = 'IPC' group by event_type, event, queryid;
 event_type |          event           | queryid | count
------------+--------------------------+---------+-------
 IPC        | CheckpointDone           |       0 |    14
 IPC        | CheckpointStart          |       0 |     6
 IPC        | MessageQueueInternal     |       0 |     1
 IPC        | MessageQueueReceive      |       0 |     1
 IPC        | ProcArrayGroupUpdate     |       0 | 13750
 IPC        | RecoveryConflictSnapshot |       0 |     1
 IPC        | SafeSnapshot             |       0 |     1
 IPC        | SyncRep                  |       0 | 21348
 IPC        | XactGroupUpdate          |       0 |  1148
select event_type, event, queryid, count(*) from pg_wait_sampling_profile where event in ('WALWrite', 'SyncRep') group by event_type, event, queryid;
 event_type |  event   | queryid | count
------------+----------+---------+-------
 LWLock     | SyncRep  |       0 |  8886
 IPC        | SyncRep  |       0 | 21359
 IO         | WALWrite |       0 |  7337
 LWLock     | WALWrite |       0 | 20102
show pg_wait_sampling.profile_queries;
 pg_wait_sampling.profile_queries
----------------------------------
 all

PG version is 13.18

as far as I understood from source code 0 is set for queryid if nesting_level == 0 but I can't understand why it happens for that wait events, could you please help me with it

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions