Skip to content

pg_wait_sampling tracks queryId just for top-level queries #43

Closed
@maksm90

Description

@maksm90

Recently there was discussion #42 (comment) about unwanted usage of queryIds taken from PgBackendStatus entries in BackendStatusArray as they represent only top-level queries. But current implementation behave in similar manner: once queryId was kept all successive nested queries cannot submit their own queryIds.

The open question here - how to organize tracking queryIds for nested queries? @rjuju AFAICS in pg_stat_kcache this problem is also not solved - all inner queries rewrite queryId of previously executing queries before executor running. Maybe it makes sense to store queryId in some shared stack structure allocated for each process slot and using it keep/restore queryId for upper-level queries?

Metadata

Metadata

Assignees

No one assigned

    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