Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL][ASH] Generate query ID for utility statements (DDLs) #19136

Closed
1 task done
hbhanawat opened this issue Sep 17, 2023 · 0 comments
Closed
1 task done

[YSQL][ASH] Generate query ID for utility statements (DDLs) #19136

hbhanawat opened this issue Sep 17, 2023 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@hbhanawat
Copy link
Contributor

hbhanawat commented Sep 17, 2023

Jira Link: DB-7934

Description

- Currently query id is not generated for DDLs. Ensure that the query id is generated for DDLs

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@hbhanawat hbhanawat added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage area/active-history Active history of sessions labels Sep 17, 2023
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue labels Sep 17, 2023
@yugabyte-ci yugabyte-ci removed area/active-history Active history of sessions status/awaiting-triage Issue awaiting triage labels Sep 17, 2023
@hbhanawat hbhanawat added the area/active-history Active history of sessions label Sep 18, 2023
@hbhanawat hbhanawat changed the title [YSQL][ActiveHistory] Generate query ID for utility statements (DDLs) [YSQL][ASH] Generate query ID for utility statements (DDLs) Jan 3, 2024
@yugabyte-ci yugabyte-ci removed the area/active-history Active history of sessions label Jan 17, 2024
abhinab-yb added a commit that referenced this issue Feb 5, 2024
Summary:
`pg_stat_statements` generates a query id for utility statements using the
redacted query string, but it doesn't set this query id in the internal
data structures. Although, it still fills up the hash table with this query id, so when
we query `pg_stat_statements`, we can see that the query id is non-zero
for utility statements as well.

Previously, ASH used whatever query id was set by `pg_stat_statements`
for its metadata. But it doesn't work in case of utility statements as it is
always zero.

This diff recalculates the query id if it is zero in the same way that
`pg_stat_statements` does, and sets it in the ASH metadata.
Jira: DB-7934

Test Plan: ./yb_build.sh --java-test TestYbAsh#testUtilityStatementsQueryId

Reviewers: jason

Reviewed By: jason

Subscribers: hbhanawat, yql, amitanand

Differential Revision: https://phorge.dev.yugabyte.com/D31784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants