You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASH assigns a query id to each statement, it doesn't check if it's a nested statement or not. It can cause discrepancy when that same query id is not in pg_stat_statements.
If pg_stat_statements is only tracking the top level query, and not the nested statements, then the nested statement's samples might be ignored when joined based on query id.
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
I confirm this issue does not contain any sensitive information.
The text was updated successfully, but these errors were encountered:
…ements is tracking it
Summary:
ASH's query id is the same as the one present in the pg_stat_statements view. In case of
nested queries, pg_stat_statements may or may not track them, depending on the guc
`pg_stat_statements.track`. This diff tracks the nested query ids with ASH only if
pg_stat_statements is also doing it.
This diff also avoids setting the query id in the post_parse_analyze hook, because in some
cases of nested queries, only the post_parse_analyze hook is called and no subsequent
ExecutorEnd / ProcessUtility hook is called, in which case we would push the query id to the
stack but never pop it. Now, we start tracking the query id at the start of ExecutorStart /
ProcessUtility hook and stop tracking it at the end of ExecutorEnd / ProcessUtility hook or
if there is some error encountered in between.
Jira: DB-10002, DB-11281
Test Plan: ./yb_build.sh --java-test TestYbAsh#testNestedQueriesWithAsh
Reviewers: jason
Reviewed By: jason
Subscribers: hbhanawat, yql, amitanand
Differential Revision: https://phorge.dev.yugabyte.com/D34773
…ements is tracking it
Summary:
ASH's query id is the same as the one present in the pg_stat_statements view. In case of
nested queries, pg_stat_statements may or may not track them, depending on the guc
`pg_stat_statements.track`. This diff tracks the nested query ids with ASH only if
pg_stat_statements is also doing it.
This diff also avoids setting the query id in the post_parse_analyze hook, because in some
cases of nested queries, only the post_parse_analyze hook is called and no subsequent
ExecutorEnd / ProcessUtility hook is called, in which case we would push the query id to the
stack but never pop it. Now, we start tracking the query id at the start of ExecutorStart /
ProcessUtility hook and stop tracking it at the end of ExecutorEnd / ProcessUtility hook or
if there is some error encountered in between.
Jira: DB-10002, DB-11281
Test Plan: ./yb_build.sh --java-test TestYbAsh#testNestedQueriesWithAsh
Reviewers: jason
Reviewed By: jason
Subscribers: hbhanawat, yql, amitanand
Differential Revision: https://phorge.dev.yugabyte.com/D34773
Jira Link: DB-10002
Description
ASH assigns a query id to each statement, it doesn't check if it's a nested statement or not. It can cause discrepancy when that same query id is not in pg_stat_statements.
If pg_stat_statements is only tracking the top level query, and not the nested statements, then the nested statement's samples might be ignored when joined based on query id.
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: